News for hackers. Stuff that matters.
Re:Reining in the thundering herd: Getting to 80% CPU utiliz... by stuaxo on Monday August 16, 2021 @05:16AM (#28196283)
Silly question, but under nginx or apache do django instances persist or are they recreated for every new request?
Re:Reining in the thundering herd: Getting to 80% CPU utiliz... by aeyes on Monday August 16, 2021 @03:24PM (#28201809)
The standard gunicorn configuration (and the one shown in the blog post) never restarts worker processes.

gunicorn has an option --max-requests to restart every X requests but unless you have unfixable memory leaks there is no reason to do this.

Nginx can't directly run WSGI applications, you can do it with Nginx Unit which also never restarts processes.

Re:Reining in the thundering herd: Getting to 80% CPU utiliz... by zbentley on Tuesday August 17, 2021 @05:18AM (#28207793)
> unless you have unfixable memory leaks there is no reason to do this.

It's also useful to set this threshold to prevent long-lived connections to services/datastores not used by every request from accumulating and consuming resources on those services.