I've just started getting emails from my web host (Dreamhost) telling me my CPU usage is too high. I've read lots of forum posts about this, and see that many people have had similar issues. What I'd love to know is what other folks are running, so I can figure out if there's something wrong with my configuration or if I really do need a dedicated server.

At this point, I'm not even halfway through transferring my ~150-ish page site into Drupal. The site (http://www.crochetme.com) gets around 110,000 visits/month.

I'm using the following modules in 4.6.3: three custom content modules (similar to page or story), adsense, banner, flexiblock, forward, front_page, menu, node, node_type_filter, page, path, pathauto, print, sidecontent, statistics, statistics_trends, taxonomy, taxonomy_browser, throttle, tinyMCE, and tracker.

I have clean URLs working, and have fixed the PHPSESSID problem, hoping this will help.

If you've had trouble with CPU usage and Dreamhost (or any other host), are you using as many modules? Do you get as much (or more or less) traffic? I'd really appreciate any info you can share that will help me decide what to do. Thanks!

Cheers,
Kim

Comments

kbahey’s picture

Are you running PHP as CGI or as an Apache module?

I had a client hosting at Dreamhost, who was running as a module, but got issues with PHPSESSID, they told him to go CGI, then when I did that for him, he started getting messages from them about CPU usage.

He ended up going back to Apache module mode, then went dedicated after that because of his volume.

Read about some of it here.

That said, statistics_trends, and tracker eat up a lot of CPU time. Not sure about the rest.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

kim-werker’s picture

I'm running PHP as CGI. The fix we did on PHPSESSID was from your page (thank you so much for that information! It helped a lot).

I'll disable statistics_trends and tracker for now; I hadn't known they were so demanding. I think I'll end up having to go dedicated -- I just wanted to see if maybe I was doing something wrong.

Thanks!
Kim

http://www.crochetme.com
This is your brain on yarn.

killes@www.drop.org’s picture

PHP as CGI is a plain stupid thing to do, it will eat plenty of ressources.
--
Drupal services
My Drupal services

kim-werker’s picture

Okay. Why? I'm a newbie, and I'd really love to understand all of the factors at play in this. If I uncheck that box in my DH control panel, will anything else on my site be affected? I'm still running my blog in WordPress and my forum in phpBB.

Kim
---
http://www.crochetme.com
This is your brain on yarn.

killes@www.drop.org’s picture

For each page request a new process is started. Running php as cgi only makes sense if you need special php extensions that dreamhost does not provide by default.
--
Drupal services
My Drupal services

drupalguest’s picture

The benefits of running PHP-CGI are:

* It is more secure. The PHP runs as your user rather than dhapache. That means you can put your database passwords in a file readable only by you and your php scripts can still access it!

* It is more flexible. Because of security concerns when running PHP as an Apache module (which means it runs as our dhapache user), we have disabled a number of commands with the non-CGI PHP. This will cause installation problems with certain popular PHP scripts (such as Gallery) if you choose to run PHP not as a CGI!

* It's just as fast as running PHP as an Apache module, and we include more default libraries.

=====
Drupal hosting - Up to $70 off, use coupon: HOTPROMO

kbahey’s picture

I agree with you that security is better.

It is not as fast as a module though, it is more resource intensive for sure.

FastCGI may be a better option, but we do not have a lot of instances on people running this so far.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

killes@www.drop.org’s picture

If you want security and still have a reasonable speed of execution use mod_fastcgi.
--
Drupal services
My Drupal services

kbahey’s picture

I really should qualify my statement about tracker and statistics trends.

First, statistics trends is heavy on database queries. You can find that out by installing the devel module, and enabling the query log and see that its queries will be in red.

However, if you run statistics trends to be only visible for you as an admin (i.e. the blocks are only visible in admin and admin/*), then the site will suffer only when you visit, but not when others do.

Second, for tracker, it is slow when you have lots of comments. Again devel is your friend here. It may not be an issue depending on how many nodes and comments you have, but it could be.

Lastly, as far as Dreamhost goes, I did not like their stance on the PHPSESSID issue. For that client, they advised us to go CGI, which we did, but then they flagged us as high CPU usage when we did so! All that because they refused to enable a few silly options in php.ini.

I never had this issue with other hosts. Consider asking Dreamhost to change the few values required in php.ini, or allowing you to override them, or consider switching hosts.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

kim-werker’s picture

It looks like I'm somewhat in the clear, as the statistics trends are only visible to me as admin, and I don't yet allow comments.

Also, I got an email from DH letting me know I'm in the clear for now with my CPU usage, so at least I can put off going dedicated for a little while longer.

I really appreciate your help. Thanks!

Kim

---
http://www.crochetme.com
This is your brain on yarn.