Knowledgebase

How to reduce VPS Memory Usage?

Posted by geekwithlens, 01-12-2013, 10:25 AM
I have OpenVZ VPS. I have 512 mb guranteed ram and burstable to 1 GB RAM. My control panel shows that I am using 523 ram of 1 GB that is 51 % which is quite high for a new site with zero traffic. Here is my cp stat: http://i.imgur.com/1jpd0.jpg My server config is Nginx + PHP-FPM + MySQL + Varnish on Ubuntu 11.04 LTS (Minimal Template) MySQL was eating around 350 MB. I reduced it by twice by disabling innodb but it messed my wordpress site. So I restarted innodb. By using top command in ssh I generated memory usage stat: http://pastebin.com/BYhFcB0J Please help me to reduce my memory usage. I will post any config file if required. Thanks, HJ

Posted by net, 01-12-2013, 10:30 AM
You made a good decision to disable innodb. This is not good in VPS. Make sure to look at nginx config also, processes, etc...

Posted by geekwithlens, 01-12-2013, 10:33 AM
I enabled it again as it messed my existing wp site.

Posted by NetworkPanda, 01-12-2013, 10:36 AM
Convert your existing tables from InnoDB to MyISAM and then it will be ok to disable InnoDB. Generally speaking, InnoDB is a huge problem, it requires more RAM and it is impossible to backup/restore InnoDB MySQL tables, so do not ever use it. Better prefer MyISAM. Regarding the RAM usage, what is the memory limit set in your php.ini

Posted by geekwithlens, 01-12-2013, 10:53 AM
Thank you. Can you also tell me how can I convert them since I dont have phpmyadmin installed? I use ssh to use mysql. What will be the command for it?

Posted by NetworkPanda, 01-12-2013, 11:15 AM
Run these commands in SSH: (where database_name = the name of your wordpress database) Then for each table you have to run this command: (where table_name is the name of the table)

Posted by geekwithlens, 01-12-2013, 12:04 PM
Thanks! I converted all the tables and disabled innodb. I have reduced my memory usage by double. I wish all host should be helpful like you.

Posted by dcdan, 01-12-2013, 12:15 PM
You could also try reducing stack size: http://wiki.openvz.org/Stack_size This can give significant memory savings depending on how many threads your apps run. A practical example: http://www.lowendbox.com/blog/reduce...i-thread-apps/

Posted by BestServerSupport, 01-13-2013, 09:58 AM
Here is few tips to tweak Nginx: http://www.if-not-true-then-false.co...ps-and-tricks/



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
login to ftp by ssh (Views: 598)
Parttime reseller?? (Views: 584)
Traffic shaping (Views: 608)


Language:

Client Login

Email

Password

Remember Me

Search