Configure IBM i Apache Threads For Higher Traffic

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):

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.

Real Time Server Stats in Apache on IBM i

Real-Time Server Statistics

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.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.