Pedro Assunção

Lack of RAM will kill your blog host virtual machine

I know what you are thinking: “Well, duh Pedro, how come you didn’t know that?”.

I’ll explain: Recently i started having some service shortages on my blog. From times to times the CPU usage would just go rooftop and then nginx and apache both stopped serving requests. I am using Linode as my host, where i have a nice virtual machine (or node, as they call it) with some reasonable values in terms of CPU and bandwidth monthly usage. The weakest link was the RAM; it only had 386Mb.

A while back i developed Jumperr.com and i figured “hey, i already have the node, so i’ll just host it there”. Some time after deploying jumperr, i started noticing these shortages coming up maybe once a month, or every two weeks (i notice the pattern now, not then :) ). At some point i even considered switching hosts (to slicehost, for example), but i never thought that memory could be the problem (after all they are not that accessed anyways). Looking at the system logs i just could not figure out what made the machine stop working just like that.

About one month ago, i decided to develop a stupid website that allows you to bomb countries using a Google maps interface. And then, surprise, the shortages became more and more frequent (sometimes 4 per day!). In one of these fails i decided to try to login to the node using Linode’s ajax ssh interface on their dashboard. And that’s when i saw it: a bunch of “out of memory” errors right on the boot list. Since when you connect normally via SSH you don’t see the prompt on the remote end, i never saw these before.

So there you go, lesson learned. If it spikes, chances are you are out of memory :)

By the way, if you are a proper Linux/Unix admin, was there a log that might contain those errors that i missed?

Related:

  1. OSX: Change time machine auto backup interval The default time machine backup interval is every hour. Sometimes...
  2. Things i wanted in Apple’s iPad (tablet) Cool as it may be, i cannot but feel disappointed with Apple’s...


Categorised as: computers, findings, hardware, tips


2 Comments

  1. falso says:

    A solução é basica, deixas de usar frameworks de hype tipo Ruby on Rails e Django que consomem mais recursos por request que o OpenOffice a correr, e vais ver a utilização da memoria a baixar.

    Eu também andei a fazer um site em Django, e tipo, isso é tudo muito bonito e tal e fácil e isso tudo. O problema maior é quando vais meter em produção e vês que nem um cluster de bluegenes consegue aguentar com os recursos que isso consome.

    Primeiro, não funciona bem no apache, portanto, se queres alguma merda que precise de php ou usas o php todo martelado no nginx com fastcgis e o crl a consumir também montes de memoria, ou usas o nginx pro django, e o apache pro php.

    Abraço

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>