Drupal uses 100% CPU

Events happening in the community are now at Drupal community events on www.drupal.org.
Yogaraj's picture

Hi,

I am a drupal developer , I used to create thumbnails for the uploaded images via Image cache actions in drupal 7.0 it takes about 100% CPU utilization. I use amazon EC2 with m1.small as my server and stored images in amazon s3 bucket, but i am creating the thumbnails in my EC2 server and then pushing to S3 via cron job, i also tried creating thumbnails using normal PHP (using imagecreatefromjpeg() and imagejpeg() functions) and setting it as a cron job for every 5min ..
, which also takes around 100% of cpu.

I tried to increase the "apc.shm_size" in php.ini
but no improvements.

How can i reduce the CPU usage?Any suggestions please..

Thanks,

Comments

Resizing images is simply

lotyrin's picture

Resizing images is simply very CPU/memory intensive.

If you have an extremely large initial collection of images which need processed, you might look into (especially since you have things in S3 already) spinning up ImageMagick on a High CPU instance to generate the different styles for your initial set of images, then let Drupal on your small instance just keep up with any new uploads.

A simpler way, but one which would create some downtime, would be to resize the instance up to a High CPU instance until it catches up with generating all the derivative images.

More than increasing server memory...

geekgirlweb's picture

I highly recommend checking out nnewton's presentation on "REAL WORLD PERFORMANCE ANALYSIS: HOW TO IDENTIFY PERFORMANCE PROBLEMS IN YOUR OWN SITES"

http://denver2012.drupal.org/program/sessions/real-world-performance-ana...

I attended it at DrupalCon Denver and it was most useful, while we can try all the "low-hanging fruit" of changing minor settings here and there to improve caching, the underlying problem can often be our code or more importantly even bigger settings for our specific configs that we miss.

But yes if you are running cron that often to generate image thumbnails, depending on the size of your database and the queries there could be other slow downs. Definitely take a look at the tools that are listed there.

Cheers,
Rebecca

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: