I'm running a large number of background tasks on a PostgreSQL server, using Sidekiq to update records from an external source. But whenever I start writing from the background process, my SELECTs suffer and the web app becomes slow.
What's the best strategy to avoid blocking reads?
You could use the terminal command "renice"
renice -p 1337 -n 5
This changes the priority of process with id 1337 to have a new priority of 5. The process scale works from -20 to 20 where -20 is the highest priority and 20 is the lowest priority.
http://manpages.ubuntu.com/manpages/precise/en/man1/renice.1posix.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With