Forum Moderators: phranque

Message Too Old, No Replies

What value for RLimitMEM?

         

csdude55

5:53 am on Dec 12, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've mentioned before that I've been dealing with unexplained server spikes for weeks now, maybe months :-O They're totally sporadic and I can't find a pattern: one request the server load will be 0.6, and the next request jumps up to 150!

Today I noticed that there were two httpd requests with high CPU usage that had been running for a long time. I tracked the PID of one of them in the access log back to Google Imagebot, but 2 hours prior! So I guess it opened but then never closed? I'm not sure.

I tried turning off KeepAlive in the thoughts that it would force a new PID for each request instead of having one open forever like that, but then my server load kept spiking over and over! So that was no good.

Then I enabled RLimitMEM, and I haven't had a major spike since! The highest I've seen is 15... high, but nowhere near the 150 I'd been seeing before!

WHM/cPanel has a recommendation of a value of 796M for the RLimitMEM value, but I don't know if that's generic or based on some calculation on my server.

Any suggestions on calculating a "proper" value?

csdude55

6:29 pm on Dec 12, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's been 24 hours and I haven't had any server spikes since enabling RLimitMEM! :-)

Looking at my server's memory:

       total    used    free   shared buff/cache  available
Mem: 8388608 3050184 184228 132548 5154196 5205860
Swap: 2097152 550328 1546824
Total: 10485760 3600512 1731052


I don't think the spaces will transfer so that'll be hard to read, but I think the key point is that total RAM + swap is 10,485,760; eg, 10G.

I have Server Limit set to 256, which I think means that there can be a max of 256 concurrent connections.

Based on that, would the RLimitMem be set to 10485760/ 256? Which would be 32kb instead of 796MB, but that seems way too low.