title: Postgres: prioritize main application over background celery jobs
body: <p>I'm working on django application that uses celery for background tasks.
  Those tasks parse users uploads, make some api calls and then write results to postgres database. Celery is running with 20 workers. 
  Sometimes, when user uploads bigger file (like 200k records to process), main site becomes unavailable because database is overloaded by celery task queries.</p>
  
  <p>Do you know how can I solve it?</p>
  
  <p>On one hand - I can just reduce number of celery workers and make parsing slower, on the other hand - it would be great to make use of free resources, when there's not a lot of people using main site.</p>
  
  <p>I'm not very experienced with postgres configuration, so i'm not sure if I need to modify postgres or celery configuration, or even modify the tasks.</p>
  
  <p>Please, tell me how you would solve it or maybe tell me in which direction I should read documentation.</p>
  
  <p>Thank you</p>