Lessons learnt from setting up a low memory VPS with CentOS

So recently I decided to scaled down even further in the cloud (well, webfaction is good but it’s shared, and many of the cloud services online are just expensive [Azure’s cheapest with 1GHz dedicated core and 768MB RAM costs around USD$9 a month, while AWS’s crappy micro instance throttles my server to a standstill regularly]), and I found this. Got their $19/year plan, and it comes with 192MB RAM, burstable up to 220MB, with CentOS 64bit.

I got one, and all was well, that was, at least before I ran yum update (note, i tested on ubuntu and they had the same problem, so stop saying it’s a red-hat issue =P). The second I ran yum update, tons of malloc/not-enough-memory errors started popping out. So, first lesson of the day, disable yum’s fastest mirror plugin (edit the file /etc/yum/pluginconf.d/fastestmirror.conf and set enabled=0).

After you do that, if you try updating again, you’ll run into bigger problems. The installation will crash halfway, and before you know it, you will have 2 version of everything on your machine, and fixing it requires you to remove the stuff one by one. The fix for this is to limit the stack size in the operating system. Set your maximum stack size to the amount of RAM you have (ulimit -s 192), and you will be fine. I put it in my /etc/rc.local file to ensure that the limit was always there when scripts were being run.


I am a Senior Engineer with Singapore Power, and have a passion for security and distributed systems. Prior to this, I have worked in companies including PayPal, 99.co, and Nugit. I also headed GeekcampSG from 2012 to 2014, and am currently focusing my free time on social empowerment initiatives including IAmTalentedSG, and CollaborateSG. When not doing work, or any of these stuff, I can be found cafe hopping/taking photos/trekking.

2 thoughts on “Lessons learnt from setting up a low memory VPS with CentOS

  • December 17, 2012 at 7:39 am

    erm , that also expensive, you should try linode , $19.95 for 512MB and it’s quite famous around geeks.

    • December 26, 2012 at 10:26 pm

      linode is expensive. alienlayer has a $4/month for 512MB RAM offer on now


Leave a Reply

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