Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
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
add comment

1 Answer

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
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.