Skip to main content

Apache Multi-Processing Modules (MPMs)

    The MPM modules allow you to use threads or even move apache to a different OS
We have three different MPMs and we can activate one module only. Alright let’s talk about the 3 MPMs
·         The worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time. Worker generally is a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM.
·         The event MPM is threaded like the Worker MPM, but is designed to allow more requests to be served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests.
·         The prefork MPM uses multiple child processes with one thread each. Each process handles one connection at a time. On many systems, prefork is comparable in speed to worker, but it uses more memory. Prefork's threadless design has advantages over worker in some situations: it can be used with non-thread-safe third-party modules, and it is easier to debug on platforms with poor thread debugging support.
In apache 2.4 the prefork MPM is the default module , the aim of this lesson is to give you an overview about different MPMs but which one to enable and configure is up to you depending on your needs.
Alright , now let’s talk about MPM directives to understand it together before we use them in our configuration
StartServers (Prefork, Event, Worker MPM)
sets the number of child server processes created on startup. As the number of processes is dynamically controlled depending on the load there is usually little reason to adjust this parameter
MinSpareServers (Prefork MPM)
Sets the desired minimum number of idle child server processes. An idle process is one which is not handling a request. If there are fewer spareservers idle then specified by this value, then the parent process creates new children at a maximum rate of 1 per second. Setting this parameter to a large number is almost always a bad idea.
MaxSpareServers (Prefork MPM)
sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes. If there are more idle processes than this number, then they are terminated.
Unless your website is extremely busy, this number should not be set too high, since idle processes consume valuable resources.
ServerLimit (Prefork, Event, Worker MPM)
When using Prefork MPM ServerLimit is only used in case you need to set MaxRequestWorkers higher than 256 (default). In this case you should match the value you have set for MaxRequestWorkers, but you should not set the value of this directive any higher than what you might want to set MaxRequestWorkers to.
For the worker and event MPMs, this directive in combination with ThreadLimit sets the maximum configured value for MaxRequestWorkers for the lifetime of the Apache httpd process.
For the event MPM, this directive also defines how many old server processes may keep running and finish processing open connections.
ThreadLimit (Event, Worker MPM)
This directive sets the maximum configured value for ThreadsPerChild for the lifetime of the Apache httpd process. Any attempts to change this directive during a restart will be ignored, but ThreadsPerChild can be modified during a restart up to the value of this directive.
Special care must be taken when using this directive. If ThreadLimit is set to a value much higher than ThreadsPerChild, extra unused shared memory will be allocated. If both ThreadLimit and ThreadsPerChild are set to values higher than the system can handle, Apache httpd may not start or the system may become unstable.
Do not set the value of this directive any higher than your greatest predicted setting of ThreadsPerChild for the current run of Apache httpd.
ThreadsPerChild (Event, Worker MPM)
This directive sets the number of threads created by each child process. The child creates these threads at startup and never creates more. If using an MPM like mpm_winnt, where there is only one child process, this number should be high enough to handle the entire load of the server. If using an MPM like worker, where there are multiple child processes, the total number of threads should be high enough to handle the common load on the server.
MaxRequestWorkers / MaxClients (Prefork, Event, Worker MPM)
MaxRequestWorkers was called MaxClients before Apache version 2.3.13. However, the old name is still supported. It sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxRequestWorkers limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced.
If this value is set too low, connections sent to queue eventually time-out; however, if this directive is set too high, it causes the memory to start swapping.
For non-threaded servers (i.e., prefork), MaxRequestWorkers translates into the maximum number of child processes that will be launched to serve requests. The default value is 256; to increase it, you must also raise ServerLimit.
MaxRequestWorkers and ServerLimit should have equal or near equal values with MaxRequestWorkers never exceeding ServerLimit. For servers under high load this value should be increased.
MaxConnectionsPerChild (Prefork, Event, Worker MPM)
MaxConnectionsPerChild sets the limit on the number of connections that an individual child server process will handle. After MaxConnectionsPerChild connections, the child process will die. If MaxConnectionsPerChild is 0, then the process will never expire.
Setting MaxConnectionsPerChild to a non-zero value limits the amount of memory that process can consume by (accidental) memory leakage


Comments

Popular posts from this blog

oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl buildIoException SEVERE: Failed to start the server ohs1 In New Installation of FMW 12.2.1.3 on Windows Server

Problem Summery: When we are trying start OHS instance it's failing with an error. Error: 29 Mar, 2018 10:30:22 PM IST> <INFO> <Server Implementation Class: weblogic.nodemanager.server.NMServer$ClassicServer.> <29 Mar, 2018 10:30:23 PM IST> <INFO> <Secure socket listener started on port 5556> <29 Mar, 2018 10:30:54 PM IST> <INFO> <base_domain> <ohs1> <Creating directory "F:\OHS\user_projects\domains\base_domain\system_components\OHS\ohs1\data\nodemanager"> Mar 29, 2018 10:30:54 PM oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl start INFO: Starting server ohs1 Mar 29, 2018 10:30:55 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute INFO: Running F:\OHS\ohs\bin\launch.exe F:\OHS\ohs\bin\httpd.exe -DOHS_MPM_WINNT -d F:/OHS/user_projects/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1 -f F:\OHS\user_projects\doma ins\base_domain\config\fmwconfig\c...

Node Manager Username and Password for Oracle HTTP Server 12c in a Standalone Domain

Start the Ohs Instance for 12C F:\OHS\user_projects\domains\base_domain\bin>stopComponent.cmd ohs1 Step:1 Stop the OHS component F:\OHS\user_projects\domains\base_domain\bin>stopComponent.cmd ohs1 Stopping System Component ohs1 ... Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Reading domain from F:/OHS/user_projects/domains/base_domain Please enter Node Manager password: Connecting to Node Manager ... Successfully Connected to Node Manager. Killing server ohs1 ... Successfully killed server ohs1 Successfully disconnected from Node Manager. Exiting WebLogic Scripting Tool. Done Step:2   Invoke WLST offline F:\OHS\oracle_common\common\bin>wlst.cmd Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands wls:/offline> Step:3 Conne...

Avoid password prompt when using startComponent.sh to start OHS 12c

Step:1 Start Ohs With Password Prompt F:\OHS\user_projects\domains\base_domain\bin>startComponent.cmd ohs1 Starting system Component ohs1 ... Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Reading domain from F:/OHS/user_projects/domains/base_domain Please enter Node Manager password: Connecting to Node Manager ... Successfully Connected to Node Manager. Starting server ohs1 ... Successfully started server ohs1 ... Successfully disconnected from Node Manager. Exiting WebLogic Scripting Tool. Done Step:2 Store the password for avoid ohs password F:\OHS\user_projects\domains\base_domain\bin>startComponent.cmd ohs1 storeUserConfig Starting system Component ohs1 ... Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Reading domain from F:/OHS/u...