Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Currently my company has 3 blogs and what I did was to install three instances of wordpress over Apache/MySQL, in different directories. The problem is that I have a Slicehost VPS with 256Mb RAM with Ubuntu8.04 and MySQL is crashing Linux or making it very slow and unresponsive. Is there some kind of optimal setup for this scenario? I know that my server is too cheap but I'm not sure either if an upgrade to 512 will fix things.

I'm thinking about migrating to nginx, but what about MySQL? Is there any solution to this? Is this the right site to post this question or is it serverfault?

Thanks

share|improve this question
    
How much traffic? Do you have WP-SuperCache installed? How many Apache worker processes do you have? –  ceejayoz Jul 15 '10 at 20:22
    
Low traffic sites actually. –  licorna Jul 16 '10 at 23:15
add comment

3 Answers

up vote 2 down vote accepted

A. Apache is a memory hog. You would get a huge performance boost if you switched to nginx with PHP via fastcgi.

B. If MySQL is really your biggest problem (doubt it), you can disable InnoDB if you don't actually need InnoDB support for something else. Edit /etc/mysql/my.cnf and add a line saying "skip-innodb", then run "/etc/init.d/mysql restart". That should save you a few dozen megs of RAM.

C. You're not cheap, Slicehost are the cheapskates. Linode (main competitor) is now $19.95 for a 512 MB "slice". Yeah, and it was a free upgrade, too. http://blog.linode.com/2010/06/16/linode-turns-7-big-ram-increase/

share|improve this answer
    
I installed nginx with fastcgi and that did the trick. The server is working great now. Thanks –  licorna Jul 19 '10 at 22:48
    
Glad to hear that helped. Also, do try out setting expire headers for static files. Will help reduce load (some), bandwidth use (maybe you care), but most importantly it'll help reduce page load time for visitors. And turn on gzip compression. The extra load (processor only, minimal w/nginx), is definitely worth it. –  intlect Jul 21 '10 at 0:00
add comment

Wordpress MU might be overkill for just three blogs, but it will let you run everything against just one database and just one Wordpress install.

share|improve this answer
1  
WP 3 includes WP MU by default now. codex.wordpress.org/Version_3.0 –  JasonBirch Jul 16 '10 at 0:12
    
yes, WP3 is the way to go. –  akira Jul 16 '10 at 5:09
add comment

Tuning a vserver takes a lot of time. Most of the time, you are playing the try & error game. And sometimes, the results are not very satisfying... But:

To tune mysql, run the tuning-primer against the mysql instance you are trying to optimize: http://www.day32.com/MySQL/tuning-primer.sh This script tells you which parameters should be changed.

If I recall correctly, there is a wordpress-mod, that uses sqlite instead of mysql, which frees lots of your precious RAM. hxxp://wordpress.org/extend/plugins/pdo-for-wordpress/

Remove all apache modules that are not in use by your applications.

Caching is always a good idea, chances are, that you will utlilize a disk cache.

Remove as many services as possible: Postfix? Not needed, take the Mailer of your ISP. Cron? It's usually a good idea to keep it. Ditching cron frees some more memory, as the scripts run by cron are no longer eating your RAM. On the other hand: you will have to rotate the logs on your own (and much more)... ssh? keep. ftp? no. use sftp (kind of ftp over ssh). It's safer and saves you RAM.

To be honest: your time and effort are most likely much more worth than an account upgrade to more RAM...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.