Introduction:

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:

  1. Log in to your Linux server via VPSrobots Control Panel by seeing the guide.
  2. Visit Breadcrumb Setting tab >> Apache2 Setting section and click More to bring up Apache tab page.

    Breadcrumb Setting tab and Apache2 Setting section on VPSrobots Control Panel

  3. 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.
  4. Click Edit in the line >> Enter the new value based on your needs >> Click OK >> click Apply.

    Change the value of MaxClients directive in Apache from VPSrobots Control Panel

How to change MaxClients for Apache with command prompt?

Start by accessing your server via an SSH client, for example, PuTTY.

Upon connection, open the Apache2.conf file with the following command:

nano /etc/apache2/apache2.conf

Next, locate the MPM you’re using, in this case, we use worker MPM, so press Ctrl + W and enter:

worker

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.