Many thanks to a post from Colin Waters for showing me a better way to run background jobs on Linux without slowing down other processes.
Previously I would have just prefixed the command with "nice" and be done with it, and that was pretty good.
Now I use "chrt --idle 0 ionice -t -c3". Actually I wrap that into an environment variable and put $NEWNICE before the command. The two commands set the kernel and IO scheduling policies for the command to IDLE.
This has been making a huge difference on my video conversion scripts, and last night it meant that I could take a 9 hour migration, consisting of image conversions that wanted 100% CPU, and run it on a production webserver without losing service.
No comments:
Post a Comment