Web server architecture with ApacheWeb application system generally by the Web server processing the client's HTTP request, the Web server is responsible for processing static pages, dynamic page forwarding to the application server, the application server and then the data access request to the database server processing,Client-->web Server--app server--database serverThe effect of MPM on Apache performanceWorker
Apache is a relatively good middleware for static resources, but not very good for dynamic requests, and Tomcat is the opposite.Apache uses more work mode, mainly prefork and worker two modes1. Prefork modePrefork mode is the process work mode, using multiple child processes, with only one thread per child process. Each process can only maintain one connection at a certain time. On most platforms, the PREFORKMPM is more efficient than the worker mpm,
If you're still using Apache when the whole world is going to be prone to nginx, you might be able to do everything you can to keep speed. You might tweak the modules to be loaded, using keepalive, fiddling with the Content negotiation module (mod_negotiation: Select a document that best matches the client's requirements from several documents), The followsymlinks directive, which allows soft links to be used in this directory, and the ability to rewrite it, you might even put in more hardware a
Today, the competition in the access network market is fierce. When deploying fiber-to-Building (FTTP) networks, it is usually difficult but necessary to make a budget early. This is because business providers should not only consider the initial installation fee, but also the unexpected business operation and maintenance costs. A large number of cost budget models prove that in the design and construction stages, the correct method for connecting FTTP networks in different segments is more accu
Multi-port Business terminal MST with factory prefabricated connectors and indoor optical cables are equipped with environment-resistant connectors and adapters in terminals, making it possible to build plug-and-play FTTX infrastructures, and plug-and-play structures can significantly save installation costs compared to traditional optical-fiber continuation methods.
Today, fibre to User (FTTP) network des
1 , Redhat Linux View below Apache Version number
Under Apache installation directory bin, use the following command to view it.
Use command:./httpd-v
Example:
2 , view Apache Current mode of work
Apache has prefork and worker working mode
Use command:./apachectl–l
Example:
From the above results know that at that time httpd work in the prefork mode.
When configure, you can set the working mode to either worker mode or Prefork mode by specifying parameters.
Use command:./configure–with-
Modules:Core.cPrefork.cHttp_core.cMod_so.c5 Apache MPM (Multi Process Modules)MPM is mainly responsible for the implementation of network monitoring, request processing functions, MPM have a variety of, the purpose is to achieve the optimal performance and stability in different platform environment.
Platform
depends on the available memory size of the server host. Excessive processing runs out of memory and causes the host to swap hard disks for memory , severely reducing performance. Also, when the number of processes reaches the limit, Apache rejects additional connection requests.Apache can be configured to run in pre-forked or worker multi-process mode (MPM). Either it creates new processes as additional users connect. The difference between the and
Apache two modes of operation: (mainstream) Prefork/workerPrefork mode: Default this mode (more commonly used)Higher efficiency, but larger than worker use of memoryThis multi-path processing module (MPM) implements a non-threaded, pre-derived Web server that works like apache1.3. It applies to no thread-safe libraries,Systems that need to avoid threading compatibility issues. It requires the best mpm to se
" parameter is "Win32"
Copy Code code as follows:
# CD httpd-2.4.4
# VI Include/ap_release.h
#define AP_SERVER_BASEPRODUCT "Apache"
To
Copy Code code as follows:
#define AP_SERVER_BASEPRODUCT "microsoft-iis/5.0"
# VI Os/unix/os.h
#define PLATFORM "Unix"
Change into
Copy Code code as follows:
#define PLATFORM "Win32"
--------------essay-----------------
Here a number of detours, a lot of data on the Internet to write
the path of the time to specify where the APR is installed, if not specified, it will automatically find the old version of the (05 lines at the back of the red is the specified Apr installation path).
[Root@localhost ~]# tar xf apr-util-1.5.2.tar.bz2 [root@localhost ~]# cd apr-util-1.5.2 [root@localhost apr-util-1.5.2]# ./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr [root@localhost apr-util-1.5.2]# make [ Root@localhost apr-util-1.5.2]# make Install
Fourth Step: Install htt
Optimize the concurrency of Apache servers in Linux
Optimization of Apache concurrency in Linux/UnixLinux
The Apache Http server adopts the prefork or worker concurrency control mode.
PreforkMPM
Multiple Sub-processes are used. Each sub-process has only one thread. Each process can maintain only one connection at a specified time. On most platforms, PreforkMPM is more efficient than Worker MPM, but the memory usage is much larger. Prefork's wireless p
service basic concept (DSO, MPM, etc.)Explains some of the basic concepts of Apache services, including service processes, listening ports, MPM, and DSO.The Apache service enables a master process and multiple child processes by default, and the child process is responsible for processing user requests. Master process as root userWhile the child process runs as a lower-privileged Apache user. The number of
parameters such as load: The code is as follows:Copy code StartServers 2MaxClients 150MinSpareThreads 25MaxSpareThreads 75ThreadsPerChild 25MaxRequestsPerChild 0 4. Restart the service/Usr/local/apache2/bin/apachectl restartStart apache2 in worker mode.For stability and security considerations, we do not recommend you change the apache2 running mode. Use the system default prefork. In addition, many php modules cannot work in worker mode. For example, php in redhat linux does not support t
Apache's common working mode is prefork and worker mode. Run command httpd-l or apache2-l, if the output contains prefork.c, that is the prefork mode, if the result contains worker.c, that is the worker model.
Once we know the pattern, we can edit it in Apache confextrahttpd-mpm.conf.
The code is as follows
Copy Code
## Server-pool Management (MPM specific)# ## pidfile:the file in which the server should a record its proc
Grep-V "#"/etc/httpd/CONF/httpd. conf
ServerTokens OS returns server: Apache/2.0.41 (UNIX)
ServerTokens command
: Configure the HTTP Server Response Header. This command controls whether the response header field sent back from the server to the client contains the Server OS type and compiled module description.
Syntax:
ServerTokens major | minor | minimal | productonly | OS | full
After Apache is started, there are nine processes. One master process has eight sub-processes. The main process
shared modules that are compiled as dynamic loads.
For more information, see section 3rd.
Generally, a module has many features and features can be enabled and disabled through configuration. You can view the features through configure -- help, as shown in figure
-- Enable-charset-lite supports character conversion.
-- Enable-Deflate supports Compression
-- Enable-LDAP supports LDAP
-- Enable-UserTrack supports user session tracking
The MPM function
data on the Internet to write to the apache2.4 version of the default multithreaded mode, are in the modified conf/extra/httpd-mpm.conf under the Prefork mpm parameters, but when I actually operation found, The modified system's Apache process did not increase, but there was no problem modifying this parameter under 2.2, and it was only recently discovered in the worker mode that you actually enabled worker mode to execute this command
#/usr/local/a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.