[LRUG] Server capacity

Richard Taylor richard at richt.co.uk
Mon Mar 12 09:30:00 PDT 2012


Hi Andy,

There really isn't a one-size-fits-all answer for this kind of thing, it all depends on what you're doing.  For example, when you deploy and restart the unicorn process do you spawn 5 new workers and then shut down the old 5? if so you need to be able to cope with this spike in ram without doing too much swapping otherwise your users will see a noticeable performance decrease every time you deploy.

Keep an eye on your load average and your swap usage if you see any spikes in either then you're probably utilising too much for the one box.  I wouldn't usually run one machine at more than 75% 'normal' memory usage.

Depending on what your application is doing, it is unlikely you will notice a significant improvement with one more Unicorn worker before you start to see other parts of the system degrading (how much cache memory you have assigned to MySQL for example).

For the PDF-generation, I would spawn another VPS just to do that job.  So your application creates a job, and you run the workers on the new VPS.  This means that the worker will only work on one at a time and it won't impact on your web application performance.


-- 
Richard Taylor


On Monday, 12 March 2012 at 16:11, Andrew Stewart wrote:

> Hola El Rug,
> 
> What sort of capacity do people run their servers at?
> 
> I have a Rails app on a 1-core Ubuntu 10.04 VPS with 1GB RAM. Everything runs on that box: web server (Nginx), app servers (Unicorn with 5 workers), MySQL, background jobs etc etc.
> 
> The RAM usage hovers at around 75%. I want to make the most of what I've got; is 75% too conservative? Adding another Unicorn worker would take the RAM usage to about 85%. I wonder how much memory it's sensible to use up.
> 
> Another thing: from time to time the app renders big PDFs with Prawn, and when this happens the CPU is maxed out for potentially several minutes, adversely affecting responsiveness. What's a good way to address this?
> 
> Thanks in advance. Sorry this isn't a job ad ;)
> 
> Cheers
> Andy Stewart
> 
> -------
> http://airbladesoftware.com
> 
> 
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org (mailto:Chat at lists.lrug.org)
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120312/a2452fc0/attachment.html>


More information about the Chat mailing list