richardforth / apache2buddy

apache2buddy
Apache License 2.0
385 stars 72 forks source link

No issue, just a question #366

Closed cowellj17 closed 3 years ago

cowellj17 commented 3 years ago

Hi Richard, I am hoping you could make a recommendation for me. I ran your script and it's recommending between 394-438 MaxRequestWorkers The rest of my mpm_prefork looks like

StartServers 5 MinSpareServers 30 MaxSpareServers 64 MaxRequestWorkers 400 MaxConnectionsPerChild 100

are the rest of the numbers sufficient, or should I be changing those as well ? It's a server with 64GB Ram, dedicated-only to using apache and WebWork, if that matters thank you so much if you can help out ! Jason

richardforth commented 3 years ago

Hi Jason,

Well, strictly speaking apache2buddy doesn't much care about those numbers because they don't directly impact memory usage:

StartServers and MaxSpareServers relate to readiness ie "how many children to I want ready to serve at any one time".

On a busy server apache might take too long to spawn all the required children fast enough to serve incoming traffic.

MaxConnectionsPerChild used to be called MaxRequestsPerChild and defaulted to about 4000, by having it as low as 100, You're trading memory for CPU power, as every 100 connections the child is killed and potentially respawned. High CPU usage might indicate that number is too low - sometimes its low on purpose due to memory leak issues. Basically the lower tis number, the higher the rate of turnover of procs and therefore higher cpu cycles required to terminate and respawn children.

That's about as much as I can give you for free, and I'm under contract clause "conflict of interest" not to seek compensation for consultancy at this time.

However that explanation basically tells you why apache2buddy cant recommend anything for those figures, because its largely application / traffic based and cpu based. Apache2buddy only tunes the prefork model by max child memory usage divided by "available ram".

cowellj17 commented 3 years ago

Thank you, this helps a lot Jason