Skip to content

Instantly share code, notes, and snippets.

@Ostico
Created August 22, 2023 14:52
Show Gist options
  • Save Ostico/fdab8368356e07900c995b0b4518ca54 to your computer and use it in GitHub Desktop.
Save Ostico/fdab8368356e07900c995b0b4518ca54 to your computer and use it in GitHub Desktop.
Apache2.4 per Process memory consumption
#!/bin/bash
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
@Ostico
Copy link
Author

Ostico commented Aug 22, 2023

This is how much memory per process your Apache server is consuming.

This setting is important for making the most of Apache memory usage. By adjusting the mpm prefork module to work best with your server's needs, you can greatly improve its performance.

My result was between 45-50 MB ( results may vary, so check yours ).

So for a 5GB server ServerLimit sould be set to approximately 90: 50*90=4500MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment