When your site gets busy, your web server may need a configuration change to handle the load. We often start with the Apache web server’s ThreadsPerChild directive.
ThreadsPerChild controls how many connections can exist at once. Defaulting to 40, its value can be set in your Apache instance configuration file (for example, /www/zendphp7/httpd.conf):
# Add this directive to change default value of 40 to something larger ThreadsPerChild 100
How can we know what value to specify, other than by trial and error?
IBM provides a page of real-time server statistics, including “Active Threads” and “Idle Threads,” as part of its HTTP configuration dashboard in IBM Web Administration for i. The administration dashboard is the one that uses port 2001 and requires starting the *ADMIN web instance. For more information, see IBM’s guide to starting IBM Web Administration for i.
In the screen shot below, Active threads are zero (0), meaning there are no active connections. Idle threads are 40, meaning all 40 default threads are available. With a more active web server instance, the mix might be 23 and 17, or even 40 and 0, if the instance is at its maximum capacity. If you see all threads active, that means it’s either time to restrict access or to increase ThreadsPerChild.
We recommend reviewing real-time server statistics at various times of day, including peak times, to learn whether you should change ThreadsPerChild or other settings on your Apache instance. If you decide to permit more traffic, be sure also to increase any application limits such as PHP’s maximum child count in fastcgi.conf, or the equivalent for your application or language. Perform load testing, too, to ensure that your application can keep up.
A critical part of user experience and customer satisfaction, performance can be measured and configured at many levels: network, web server, application, database, operating system, hardware. To ensure excellent performance and scalability of your applications, contact us.