We are experiencing quite a high CPU load on our web server right now

(I'm just doing some research, I am not actually the website's administrator)

One of the most significant changes has been a new search results page with larger thumbnail images (25 per page by default). Instead of creating a new, larger thumbnail size, the developers have (for now) actually just used the full sized images at a smaller height and width – apparently because creating a whole new thumbnail size was a fairly big project

I am suspecting that this is the cause for our CPU spike, but I'm not sure - I'd like some information to share with them about it

Could someone confirm and/or explain that constantly delivering significantly larger files could cause an increased load on the CPU, and why?

For reference we have ~2,000,000 images on the website and the size of the thumbnails went up from perhaps 7kb to maybe around 30-40kb on average – individual search results pages roughly doubled in byte size overall

For traffic, we usually have about 200 concurrent users or around 150,000 pageviews per day

Update: It's funny that I should have asked this question today, because a project to create new appropriately sized thumbnails has begun this morning.

  • Operating System? Web Server? Logs? Profiling information? – kce Jul 8 '14 at 16:35
  • Hi :) Linux | Apache | Don't have | Don't know what you need – Drewdavid Jul 8 '14 at 16:47
  • Curious why the down votes? – Drewdavid Jul 8 '14 at 16:48
  • See How Can I Ask Better Questions? for general guidance. – kce Jul 8 '14 at 16:53
  • 2
    @Drewdavid BTW, not creating thumbnails of the actual size creates some other problems: the load time for the visitor is longer, especially when mobile, plus the images will look worse, because the scaling algorithm in browsers is a fast, but ugly one. – Halfgaar Jul 8 '14 at 16:54

We would need more information for an informed answer, as kce asked, but I'm going to assume it's a PHP+Apache site.

Are you sure you're counting CPU usage, and not load? The load is the amount of processes that are active. That can very well increase by having Apache workers keep busy sending images. If that's the case, the load increases, but the CPU usage doesn't really. A monitoring tool like Munin will show this nicely in graphs.

A good way to address this issue is install a reverse proxy, like Nginx, configured to serve the images. Not only is Nginx very good at static file serving, but it also keeps you Apache workers free to do real work.

  • Thanks, I edited my question to be a bit more specific. Sounds like "load" is the better word then, I didn't realize they meant different things :) – Drewdavid Jul 8 '14 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.