Portal Home > Knowledgebase > Articles Database > Xen VPS - need really good optimization
Xen VPS - need really good optimization
Posted by PirateSolutions, 10-02-2010, 06:16 AM |
Hey,
I own a Xen VPS with about 20 sites hosted there. It's 1 GB ram, 2 CPU cores and 2 GB SWAP. My VPS is going down once in a while due to HIGH CPU usage(checked with sar). I optimized mysql and sysctl but I'm not sure about Apache optimizations. I'm running cP/WHM so I guess it optimized Apache by itself. As for PHP goes I have Zend optimizer and handler is suPHP due to security reasons(I wouldn't prefer changing that).
I came up with the following in httpd.conf but I'm not sure are those values good, too high or maybe too low for a shared hosting clients?
RLimitMEM 50000000 100000000
RLimitCPU 100 150
RLimitNPROC 20 30
Any help(especially if you are running RLimit in shared env as a hosting company) would be much apprecated. Please don't link to to the documentation on RLimit, I have already read that.
|
Posted by PirateSolutions, 10-02-2010, 06:24 AM |
Update: The above config gives a 500 error.
Here is a new one:
LimitMEM 208782677
RLimitCPU 240
This is done auto by cP and doesn't give an error.
basically I need advices to improve stability of the Xen VPS and not allowing users to abuse the service with high cpu usages
|
Posted by helpyoulinux, 10-02-2010, 08:25 AM |
Your RAM is very low. 1GB is considered very low in Servers.
You should have minimum 4GB.
|
Posted by Syslint, 10-02-2010, 08:34 AM |
Do you have busy websites ? May be try the nginx server .
|
Posted by jphilipson, 10-02-2010, 09:48 AM |
Just because sar shows high load does not indicate CPU usage is the actual problem. CPU is not the only thing factored into the load average. To be honest, in 8 out of 10 cases I see, the high load is the result of another problem. For example, swapping memory, MySQL, and other high I/O processes are driving up wait time, and as a result the load goes up.
What I typically do is see if those load spikes are happening at a routing time and watch what the server is actually doing at those times.
|
Posted by InoxHost, 10-02-2010, 11:41 AM |
Yep, I am agree with jphilipson comment. Try to check what causes load using whm or top command. It could be specific site in your server that is causing more load specific time.
|
Posted by JMK940, 10-02-2010, 11:47 AM |
You can't really do much more. If you wish to stop your problems i insist you upgrade your RAM or you will keep having these problems.
|
Posted by quad3datwork, 10-02-2010, 07:31 PM |
If you are using "sar", you can monitor more than just CPU/load... I'm sure you know that already.
Like others mentioned, I/O can cause high load as well so I suggest use sar to monitor other areas as well. iostat is another tool you can use for I/O.
|
Posted by PirateSolutions, 10-04-2010, 05:17 PM |
yes I understand getting more ram and cpu cores would probably solve my problem but its out of ma budget at this time so I would like to optimize it as good as possible to users are not able to take the server down by importing BIG databases, sending a lot of emails and so on. I understand even a 4 GB ram and 8 cores CPU can be taken down with this if not optimized well.
|
Posted by Steven, 10-05-2010, 12:45 PM |
Your using shared resources being on a vps - this means you really have no idea how much cpu power you are able to use or disk io. If another vps is abusing resources your vps is going to suffer - regardless of what your host says. There is VERY FEW hosts that have any sort of reliable load balancing on their nodes.
|
Posted by PirateSolutions, 10-05-2010, 01:56 PM |
Yes Steven, you got the point but it's Xen platform so VM's are more isolated and limited CPU cores per VM on high-end node. However, it's possible to overload the node if MULTIPLE VM's are using ALL allocated CPU cores in the SAME time. That's how I understand it.
I just need more ways to improve stability of my vm on my side as my customers are overloading it e.g sending loads of emails or repairing HEAVY mysql databases. That's why I want to limit them.
|
Posted by surfaces, 10-06-2010, 04:15 AM |
Install Nginx or Lighttpd. That should solve your problem.
Enable Caching.
Host your images on a imagehoster (If the website is not a business website).
|
Posted by Steven, 10-06-2010, 11:45 PM |
Regardless of what you do on the vps. Both of those functions are disk io intensive. You cannot control how much io you have to work with.
|
Add to Favourites Print this Article
Also Read
Yahoo bot (Views: 761)