Skip to content

Instantly share code, notes, and snippets.

@keopx
Last active July 7, 2017 08:44
Show Gist options
  • Save keopx/9ae2c8a93a42725899883bf14aec3f89 to your computer and use it in GitHub Desktop.
Save keopx/9ae2c8a93a42725899883bf14aec3f89 to your computer and use it in GitHub Desktop.
Concurrent connections Apache
#!/bin/bash
# RAM consumed in MB per connection
ps -ylC apache2 --sort:rss | awk '{SUM += $8; I += 1} END {print SUM/I/1024}'
# System consumed in MB.
ps -N -ylC apache2 --sort:rss | awk '{SUM += $8} END {print SUM/1024}'
(RAMTOTAL – RAM_RESTOPROCESOS) / RAM_POR_CONEXIÓN
Example:
(4096 – 800)/10= 329 conexiones simultáneas
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# New setup --> ServerLimit 270
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 270
MaxClients 250
MaxRequestsPerChild 0
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment