Troubleshooting Site Slowness on a Nginx + Gunicorn + Django Stack

前端 未结 3 547
孤独总比滥情好
孤独总比滥情好 2020-12-30 02:11

Issue I Was Having

I was having an issue where some sites were taking a long time to load (By \"long time\" I mean up to 16 seconds). Sometimes they might timeout

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 02:25

    Regarding:

    Regarding your answer to 5, I believe what Gunicorn recommends is overkill.

    I recently performed some ad-hoc testing with the number of workers and found that, assuming you have enough RAM, that that 2*cores+1 rule of thumb is pretty accurate. I found that requests/sec increased almost linearly until I got close to that number, then dropped off as the OS started to thrash.

    Since results depend greatly on workload, try different values and see where your performance peaks.

提交回复
热议问题