The MaxClients directive in Apache defines the maximum number of requests that will be handled by Apache Web Server at a time. If this number is exceeded, the connections will be queued until a server is available.
Setting this directive to a reasonable value can prevent the server from consuming all system resources when it receives an overwhelming number of client requests.
Now, let’s check how to tune MaxClients in two different ways:
- VPSrobots Control Panel
- SSH client, PuTTY
How to change MaxClients for Apache with VPSrobots?
The process is fairly easy to follow:
- Log in to your Linux server via VPSrobots Control Panel by seeing the guide.
- Visit Breadcrumb Setting tab >> Apache2 Setting section and click More to bring up Apache tab page.
- Find the search bar and enter MaxClients, this will highlight the directive line in blue in Apache Config sub-tab. Note: there will be three results with different MPMs. Choose the one with the MPM you’re using.
- Click Edit in the line >> Enter the new value based on your needs >> Click OK >> click Apply.
How to change MaxClients for Apache with command prompt?
Upon connection, open the Apache2.conf file with the following command:
Next, locate the MPM you’re using, in this case, we use worker MPM, so press Ctrl + W and enter:
Then move to the MaxClients directive line and change the value to meet your needs:
After that, press Ctrl + X, enter Y, hit the Enter and back to the terminal window.
Lastly, restart your Apache:
service apache2 restart
That’s it! Now you know how to set a value for the MaxClients directive in Apache with the methods mentioned above. Which one would you like to give a try? Meanwhile, we also recommend you a short guide on How to enable CacheStorePrivate Apache directive with VPSrobots.