0

I have a website that generate images for each user, which are stored in /images/user/. I have a server with 8 CPUs, so maximum server load should be 8, but the load on my server reach 100, 150, 200. Average image size is 50 KB, average number of images created in 1 day is more than 50,000. The only way to decrease load is empty the images directory.

Is there any way to reduce the load to normal range?

Note : I thought to grouping generated images in more than 1 folders depend on date + time, such as:

  1. images/user/18/11/15/10
  2. images/user/18/11/15/11
  3. images/user/19/11/15/1

Is that will make a difference?

Ondra Sniper Flidr
  • 2,623
  • 11
  • 18
  • 4
    There is insufficient information here. I don't know why you think breaking things up into sub folders should make a difference, but if it is easy for you to test go ahead. Is your problem I/O? You need to find the root source of your problem. What specific task or thing is causing the load? How long does it take to generate 1 image? How long does it take to generate 8 images in parallel? Once you figure out how long it takes for a small set of images, math it out and figure out how long it should take for a typical days worth of images. – Zoredache Nov 18 '15 at 21:05
  • 2
    Related: http://serverfault.com/a/736876/126632 – Michael Hampton Nov 19 '15 at 03:50

1 Answers1

2
  • Is there any way to reduce the load to normal range?

Use scientific method to analyse the problem this really is science not guesswork.

  • Use the usual tools, sar, free, top, iostat vmstat etc to gather information about your system.

  • Make an informed decision about what changes to make.

  • Monitor your system to see if the changes helped. If the didn't reanalize, rinse and repeat.

user9517
  • 114,104
  • 20
  • 206
  • 289