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?

  • 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: serverfault.com/a/736876/126632 – Michael Hampton Nov 19 '15 at 3:50
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.

  • It seems your link is broken... – GregL Nov 19 '15 at 13:25

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.