I have a feature in my CMS that allows a user to upload a zip file full of images and the server will extract them and insert each one into an image gallery. I've noticed that this grinds up the CPU quite severely and causes other requests to slow down.
I'm thinking of using the delayed_job plugin to delegate each image addition into the background, but I also want to give that process a lower CPU priority so that it doesn't bog down the server.
I'm pretty confident in the delaying part of the exercise, but the throttling part is where I'm stuck. Is there a ruby way of lowering the priority of a method call?
It's the image resizing that causes the CPU chew.
Any ideas welcome :)