WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I notice it uses high cpu when I load images from my media library. I have about over 1 million images uploaded and they are organized into folders by Post ID. Any tips to reducing CPU?

share|improve this question
which cpu, the client machine or the server?, and what is exactly high. please give as much details as possible. – Mark Kaplun Mar 2 '13 at 13:50
I wouldn't expect any especially CPU when loading an image-- when saving the image, possibly, but not when loading it--, unless maybe the images are enormous, there are a lot of them, or you are loading via some script that does some processing at load time-- my-image-loader.php, or my-image-loader.js, something like that. Any of that sound familiar? – s_ha_dum Mar 2 '13 at 15:25

When you upload an image, WordPress generates multiple images for each image size, e.g. medium, thumbnail, large etc

If you have a lot of custom image sizes you could cut down, but uploading 1 million images is going to take a lot of cpu, even without the resizing.

On top of that, each upload generates an attachment post, meaning your site effectively has at least 1 million posts to handle. This slows down listings considerably. Your CPU will be busy handling the queries for those posts in mysql, and grabbing each.

Given the sheer quantity, the only real tip I can give you that will have any noticeable impact, is to start deleting images.

share|improve this answer
someone downvoted me, why? Is there something wrong with my answer? – Tom J Nowell Mar 11 '13 at 11:32
that'd be me. I downvote your comment by mistake when I was using my left hand with mouse. Sorry about this. – Jesse Mar 11 '13 at 12:48
Ah no worries ^_^ – Tom J Nowell Mar 11 '13 at 14:02

Your Answer


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.