Apache mpm windows




















Serverlimit Information. There is an assortment of additional MPMs available. These have specific MPMs which are requirements or utilizing Apache on their respective system types. These types of MPMs are beyond the purview of this article. When considering optimization, it is essential to understand there is no such thing as a one-size-fits-all Apache configuration.

Correctly choosing an MPM requires analysis of many moving variables like traffic, site code, server type, PHP Handler and available hardware. Every server is unique making the best MPM an entirely subjective choice. If your application code does not support multi-threading, then your choice will inevitably be MPM Prefork purely on a compatibility basis. The scalability and flexibility of MPM Event is a solid choice for hosting multiple small to medium sites in a shared hosting configuration.

Most simple servers setups operate well under the self-governing default configuration of MPM Event, making it an ideal starting point for optimization tuning. Once chosen, an MPM can then move onto Configuration Directives to review which settings pertain to server performance and optimization. A veteran of the IT Support field, I have more than a decade of experience in systems administration, web hosting, and cPanel servers.

I enjoy writing and providing complicated technical concepts in layman terms. On my free time, I enjoy playing several types video games, automation scripting and just living life with my wife and two kids. Join our mailing list to receive news, tips, strategies, and inspiration you need to grow your business. Our Sales and Support teams are available 24 hours by phone or e-mail to assist.

Search Search. Apache Performance Tuning. MPM Prefork. Avoid using MPM Prefork whenever possible. MPM Worker. MPM Event. MPM Event is stable in Apache 2. These requests are far less taxing on server resources which allows Apache to handle larger volumes of requests, such as those beyond MaxRequestWorkers. The least number of Threads that should remain open, waiting for new requests. Spare threads are idle workers threads. These threads are merely waiting for new incoming requests and are governed by the Apache child process that spawned them.

This directive governs the total number of idle threads allowed on the server across all children. Any threads above this limit direct their parent to shut down to reduce memory consumption during off-peak hours. Having a limit to the number of idle open threads is excellent for smaller servers with hardware constraints. However, it mostly unneeded on today's modernizing hardware.

This directive governs the initial amount of children the Apache Parent process spawns when the Apache service is started or restarted. This is commonly left unchanged since Apache continuously checks the current running children in conjunction with ThreadsPerChild and compare it to MinSpareThreads to determine if more children get forked.

This process is repeated perpetually, with a doubling of new children on each iteration, until MinSpareThreads is satisfied. The number of requests a single Apache child process can handle equals a cumulative total on the child server across all threads it controls.

Each request handled by a thread counts toward this limit to its parent. Once the child server has reached its limit, the child is then recycled. This directive is a stop-gap for accidental memory leaks. Some code executed through Apache threads may contain memory leaks.

Leaked memory are portions of memory that subprocess failed to release properly, so they are inaccessible to any outside processes. The longer a leaking program is left running, the more memory it will leak.

Setting a MaxConnectionsPerChild limit is a specific method for assuring Apache is periodically recycling programs to reduce the impact of leaked memory on the system. This MPM Prefork section details the use and performance considerations for various directives when running this module.

This MPM is a non-threaded multi-processor designed for compatibility. It consists of a single Apache parent process, which is used to govern all new Apache processes also known as children. There is a ratio of Apache processes to incoming requests.

However, MPM Prefork does not scale well with hardware and the more traffic it encounters, the more hardware it will need to keep up with the pace. It should be noted that some directives behave differently based on which MPM is loaded. The information provided in this section is only the portion about MPM Prefork. Used to control the upper limit of children that the Apache parent server is allowed to have in memory at one time. These children also called workers handle requests on a ratio.

This translates into the maximum number of simultaneous requests the server can handle. If this directive is too low, Apache under-utilizes the available hardware which translates to wasted money and long delays in page load times during peak hours. Alternatively, if this directive is too high, Apache outpaces the underlying hardware sending the system into thrashing link to thrashing article scenario which can lead to server crashes and potential data loss.

This directive defines a minimum number of spare children the Apache parent process can maintain in its memory. An additional server is a preforked idle Apache child that is ready to respond to a new incoming request. Having idle children waiting for new requests is essential for providing the fastest server response times. When the total idle children on the server drop below this value, a new child is preforked at the rate of one per second until this directive is satisfied.

The "one per second" rule is in place to prevent surges of the creation process that overload the server, however, this failsafe comes at a cost.

The one per second spawn rate is particularly slow when it comes to handling page requests. MasSpareServers controls the maximum number of idle Apache child servers running at one time. An idle child is one which is not currently handling a request but waiting for a new request. When there are more than MaxSpareServers idle children, Apache kills off the excess. Like with MinSpareServers , this value should always be altered with available server resources in mind.

Created at startup, are the initial amount of Apache child servers. This seldom changed directive only impacts Apache startup and restart processes. Generally not altered because Apache uses internal logic to work out how many child servers should be running. Many modern servers periodically restart Apache to address configuration changes, rotate log files or other internal processes. When this occurs during a high load traffic surge, every bit of downtime matters. You can manually set the StartServers directive to mirror that of your MinSpareServers to shave off time from the Apache startup.

This setting is generally used as a safeguard or ceiling against input errors when modifying MaxRequestWorkers. It becomes necessary to adjusted ServerLimit when the server is expected to handle more than the default of requests simultaneously. ServerLimit ties in directly with the thrashing point. This directive equals the number of requests a single Apache child server can handle. Code executed through Apache may contain faults which leak memory.

These leaks add up over time making less and less of the shared memory pool of the child usable. The way to recover from leaked memory is to recycle the affected Apache child process. Setting a MaxConnectionsPerChild limit will protect from this type of memory leakage. A veteran of the IT Support field, I have more than a decade of experience in systems administration, web hosting, and cPanel servers.

I enjoy writing and providing complicated technical concepts in layman terms. On my free time, I enjoy playing several types video games, automation scripting and just living life with my wife and two kids. Join our mailing list to receive news, tips, strategies, and inspiration you need to grow your business. Our Sales and Support teams are available 24 hours by phone or e-mail to assist.

Search Search. To do this, issue the command:. You might want to bump those numbers up considerably, if you know your server is going to be under a larger load and you have the RAM to spare , you could alter that configuration like so:.

Make sure to edit those numbers according to what your hardware can handle and your expected load will require. Save and close the file. Restart Apache with the command:. If you're interested in testing this out, you can run a Perl script. Please use caution when doing so, as it is a Perl script and you just never know. In fact, you might want to download the script and comb through it first to check for any nefarious code.

Download the script with this command:. Once the command completes, you should see a report of Apache's memory usage Figure A. And there you have it. Make sure to adjust your configuration to best meet the needs of your environment and this module will serve you well.

He's covered a variety of topics for over twenty years and is an avid promoter of open source.



0コメント

  • 1000 / 1000