Home > php教程 > PHP开发 > Apache performance optimization (1)

Apache performance optimization (1)

黄舟
Release: 2016-12-21 11:23:06
Original
1339 people have browsed it

Server model:

Model: DELL1750

cpu: Intel Xeon(TM) CPU 3.06GHz

Memory: 1G

Hard drive: 70/70/70

Operating system: FreeBSD 4.8p-STABLE

Main Targeted application requirements:

Peak: 800 times/s

Daily PV traffic of 10 million.

The maximum size of each file is 0.5k bytes, all are html files.

Use the memory file system.

Table of Contents:

A brief introduction to the modular idea

Specific module customization

Key indicators affecting performance MPM

Other apache performance optimization configurations

Simple performance test

A brief introduction to the modular idea:

On UNIX systems, Apache adopts a multi-process model. In the multi-process model, its child processes handle customer requests, and the parent process is used to manage the child processes. When the system is overloaded, the parent process will start several more child processes. When the system is idle, the parent process will kill several child processes. The child process The number is between "MinSpareServers" and "MaxSpareServers". Moreover, the number of requests processed by each child process is also limited, which can solve problems such as memory leaks. All process status is recorded in shared memory. Since each child process The status of each process is recorded in a small piece of memory, and it usually only reads and writes this piece of memory. Therefore, Apache does not use any synchronization mechanism.

Apache 2.0 has added many core improvements and new features, such as Unix Threads, multi-protocol support, new build system, better support for non-Unix platforms, IPv6 support, new Apache API, filters, multi-language error responses, native Windows NT Unicode support, simpler configuration, and Upgraded regular expression library and more. It of course also includes important improvements to many modules, while also adding some new ones.

Apache is a modular server. The core server only contains the most commonly used modules, while extended functions are provided by other modules. During setup, you must specify which modules need to be included. There is a module list in the document for reference. Modules with a status of "Base" will be included in the core server by default. If you do not need to include a module (such as mod_userdir), you must explicitly disable it; modules with other statuses (such as mod_expires), must also be explicitly enabled for it to be included in the core server.

Apache has two ways to use modules. One is to permanently include it into the core; if the operating system supports dynamic shared objects (DSO) and can be detected by autoconf, the module can also be dynamically compiled. The storage of DSO modules is independent of the core and can be included or excluded by the core using runtime configuration directives provided by the mod_so module. If any dynamic modules are included in the compilation, the mod_so module will be automatically included in the core. If you want the core to be able to load DSO without actually compiling any dynamic modules, you need to specify --enable-so explicitly.

The above is the content of Apache performance optimization (1). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template