Preventing delayed_job background jobs from consuming too much CPU on a single server

前端 未结 1 1489
夕颜
夕颜 2021-02-06 18:10

My Rails application has a number of tasks which are offloaded into background processes, such as image resizing and uploading to S3. I\'m using delayed_job to manage these pro

相关标签:
1条回答
  • 2021-02-06 18:35

    If I'm not mistaken, delayed_job uses worker processes that will handle all the background jobs. It should be easily possible to alter the OS scheduling priority of the process when you start it.

    So instead of, for example:

    ruby script/delayed_job -e production -n 2 start
    

    try:

    nice -n 15 ruby script/delayed_job -e production -n 2 start
    
    0 讨论(0)
提交回复
热议问题