My Drupal 5 site crashes apache on a VPS every 2 hours ... did I pick the wrong CMS?

bflora - October 6, 2008 - 18:36

Hey guys,

I run a D5 site that's been recently featured on the HuffingtonPost, a NYTimes blog, Forbes.com, and several other top news sites. That's good.

But it crashes apache every 2 hours. Help! I'm a designer and writer, not a developer. What do I do?

- I'm paying $70/month for Gold VPS hosting at MidPhase. (technical summary here: http://www.midphase.com/hosting_vps.php)

- My site does 1-4,000 uniques/day and consumes about 14 GB in bandwidth per month. Memory seems to be the problem.

- My host is saying I'm getting too much activity on the VPS and need to upgrade to a $200 dedicated box. This seems absurd considering my traffic levels. I don't like feeling ripped off.

- I've got normal caching and CSS optimization turned on.

- I am running several modules including Views, Groups, Subdomain, CCK, Activity, Statistics, Panels and the Drigg suite of modules.

- I understand that these are memory intensive, but are they so memory intensive that I need a dedicated server for 1500 uniques?

- I've got the devel module showing my query logs. Here are the 20 most expensive ones from my homepage:

388.38 0 views_build_view
376.01 0 drupal_lookup_path
323.88 0 pager_query
272.79 0 votingapi_get_vote
256.59 0 statistics_exit
170.02 0 user_load
164.5 0 taxonomy_node_get_terms_by_vocabulary
136.56 0 drupal_lookup_path
124.44 0 views_build_view
118.26 0 taxonomy_get_vocabularies
118.03 0 drupal_lookup_path
117.39 0 votingapi_get_vote
116.19 0 user_access
104.98 0 _invite_check_messages
100.66 0 profile_load_profile
98.37 0 votingapi_get_vote
96.61 0 taxonomy_get_term
95.55 0 buddylist_block
95.14 0 user_karma_user_rank
92.83 0 og_user

It seems like I've got a few options:

1. Don't use views, path, taxonomy or the voting api.

2. Upgrade to fancier hosting.

3. Find out if something is broken or out of the ordinary in my setup and fix it.

Any help or suggestions would be appreciated. I've been working with Drupal for about 5 months now. I like that it can let you do anything. I worry, however using more than a few of the really neat modules (views, groups, path, taxonomy) requires $200+ hosting for a site that wants to sever 10,000 or more uniques/day.

Please advise on how to get my Drupal site back under control. I've got to take action of some sort. Not sure what to do at the moment, though.

More technical details

bflora - October 6, 2008 - 18:46

- MySQL version = 5.0.51a-community
- PHP = 5.2.6
- Apache = 2.2.9 (Unix)
- OS = Linux

Boost (caching)

juan_g - October 6, 2008 - 19:36

bflora wrote:
>I run a D5 site that's been recently featured on the HuffingtonPost, a NYTimes blog, Forbes.com, and several other top news sites.

Try the Boost module (static page caching for non-logged in visitors). It can reduce the load on the server greatly. It's especially useful for the Slashdot/Digg/media effect.

Advanced cache (for logged in users) can also help, as a complement.

High performance group

juan_g - October 6, 2008 - 19:51

Also, High performance is a Drupal group that you might find interesting.

I too was hosted at midphase

Chad_Dupuis - October 6, 2008 - 19:59

I too was hosted at midphase with one of my larger drupal sites (Yin Yang House). I have a larger number of visitors and slightly lower footprint, but similar issues as you. I was first canceled out of shared hosting, and then switched through a few VPS's with other companies. I eventually purchased a non-managed VPS with Linode - who I cannot say enough good things about. Anyhow, outside of the slight pain of setting up an unmanaged VPS (not really that big of a deal), I was able to add some caching to the server and other small tweaks. What was literally running out of memory on VPS's twice the size at other companies just moves along just fine now with absolutely no issues to date.

If you do decide to use Linode - I put together some notes for my setup on my consulting groups website that may be helpful for you. In particular setting up the APC PHP cache was crucial along with some other mysql optimizations. What I've learned, and already knew to some degree, is the configuration of the server will make a huge difference even when within identical plans. I had a larger VPS with futurehosting before I switched to linode and still received memory timeouts and the like even after doing some tweaking. The site was always slow and ran out of memory often, now I haven't had down time since I switched and the site clicks along nearly as fast as a static html site.

You also need to use the built-in drupal page caching services if you can, they will help quite a bit. No, you didn't pick the wrong CMS, it's just with these types of systems you need to have properly configured servers otherwise they will be slow - particularly under load.

Cheers,

-Chad.
Yin Yang House Media Services Group

nice affiliate link, dude.

bflora - October 6, 2008 - 20:13

nice affiliate link, dude. :)

Thanks for the advice though. I'll look into it.

Honestly, is that really a

Chad_Dupuis - October 7, 2008 - 12:52

Honestly, is that really a big deal? My answer was not just to put the link in and so what if I get a dime for taking the time to help you out. I'll assure you it's my last time....

It's not

Michelle - October 7, 2008 - 15:01

You're clearly answering the question, not just spamming a link. In the future, though, you might want to put "(affiliate link)" after it just to make it clear so no one jumps on you for it. :) (Not saying the previous poster was that bad... But I have seen some people really get raked for putting in affil links)

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.

I definitely am looking at

bflora - October 7, 2008 - 22:37

I definitely am looking at Linode based on your advice. Just wanted to point out that I noticed the affiliate link :)

Midphase did not have very

minesota - October 8, 2008 - 01:51

Midphase did not have very good rep as far as I can recollect from my days at webhostingtalk forums.

Changing hosts or changing the server at the same host can achive good results as most of the time it is not fault of drupal but some stupid throttles or other stuffs these hosts apply on anything less than ded servers.

Same thing happened to me

awolfey - October 9, 2008 - 02:51

I'm at midphase on a gold vps too. (vz32). After I crashed that physical server just last Friday (because of a redirect loop I caused) they tightened up the memory and cpu limits on all vps'es. That caused my site to crash pretty frequently until I enabled query caching.

Make sure you have mysql query caching enabled and set for about 50MB.

Also make sure you have drupal page caching, css aggregating and JS aggregator module up and running. With these I can keep the site up and acceptably fast. We are seeing fewer uniques than you, but bandwidth is 90gb a month at roughly 5,000 to 10,000 pages a day.

Bottom line for us is that the 340MB of memory you get with midphase's gold vps is not enough for a php mysql site with our traffic load and growth plans, on any vps, so we're upgrading to a dedicated server. It was only $40-60 more a month for us.

If you need help PM me and I can give you more details.

Aaron

 
 

Drupal is a registered trademark of Dries Buytaert.