hi recently i am facing this problem, the server load on my VPS shoots up to very high levels without any reason.. this screenshot attached is of that a scenario... i ws moitoring.. the server load was fine at 2-3... then only in a few seconds, it increases to 200 one thing i can see from this is that, there is high SWAP usage. i dont know how this is being used as i have had greater traffic on my proxy with normal loads but this time i do not know what is happening. any suggestions thanks
Looks to me like you're running out of ram as a result the server is using swap which causes high i/o wait levels thus server load goes sky high. The strange thing I can see from your TOP is that you have HTTP processes using 4.7%, 5.6%, 5.5% and 6.1% of your ram. Not knowing your configuration entirely, but going based off of what most people have their apache set to I'd say you have yourself a memory leak.
i cant really be running off the memory bcause i do not have this sudden burst of visitors.. they are decent enough and i have not had this problem before.. (my vps is getting abt 2500 visitors a day these days.. i have had 4000visitors before without any problem) what is a memory leak? how to curb it? see this screenshot of my server running fine
The memory percentages on your apache processes look quite high -- I would recommend setting your MaxRequestsPerChild to 1000 or so, that way bloated httpd processes will be recycled after too many requests, which helps reduce the impact of the memory-leak.
Do a "ps -aufx" and check which are the processes and find which file exactly is using so much of your CPU.
11.16 load average is actually very high (I doubt you have 8+ cpu's available to you but I may be wrong) So it looks to me based on your usage you're using all your ram with your apache processes. You only have 256MB of ram so each 16MB process is actually a good junk of your ram. As for your CPU usage that is coming from the one httpd process now it could have just been a temporary burst.
in lxadmin u just need to change an option in the panel to shift from apahe to lighttpd.. but when i tried to do the same i am facing this problem screenshot attached
please answer these two questions: 1. my server admin "thewird" tells me that lighttpd is good for static pages only and performs worse in case of dynamic pages? please suggest 2. here is my httpd.conf file http://pastebin.ca/809661 thanks
O.k. try this: # Timeout: The number of seconds before receives and sends time out. # Timeout 10 # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100 # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 2 ## ## Server-Pool Size Regulation (MPM specific) ## # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spa # ServerLimit: maximum value for MaxClients for the lifetime of the server # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule prefork.c> StartServers 10 MinSpareServers 10 MaxSpareServers 20 ServerLimit 200 MaxClients 200 MaxRequestsPerChild 100 Code (markup): After this, restart your apache. If your swap goes high again, please go down with your MaxClients a little bit.
Verify your traffic, looks like your having a burst or even an attack. verify - Analyze the traffic/threads/content which is using the most resources and you will find the issue.
am using @Combat's httpd.conf file for some time let see if its works (the real test will be on a monday because weekends are generally fine) also, one thing that i found a bit strange was that in my original httpd.conf file KeepAlive was turned "off". i am not sure what it does but could that have been the problem? thanks guys for all ur help
Keepalive keeps a visitor a connection for an amount of time so that pages load faster for them. It's great for sites with lots of images on pages or when visitors move around a lot. However it does use more memory and can be a real issue if you receive a lot of traffic. I think in your case this issue is not going to get fixed with any modifications. You have 256mb of ram here lets be honest that's not very much. Add in the overhead of running other services and you have absolutely no ram for your web server. Upgrade to 512MB and I imagine this issue will go away
i can shut down other unnecessary services as i hardly use this VPS for anything apart from these proxies. just let me know if there is anything running which is not necessary thanks
Well looking at your TOP readings almost all of these services are essential. There is also overhead with PHP the more modules you have loaded along with the modules loaded on your web server. The amount of work you need to make this thing work on just 256mb of ram could be better spent simply paying to upgrade the amount of ram for your VPS. At a certain point there is nothing you can really do and in this case with the minimal specs I think this is very well the case.