Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use uWSGI max-requests option?

Tags:

uwsgi

I see many of the uWSGI configs posted here and the ones I came across for existing applications at work also have max-requests populated with values from 100's to 1000's.

What is the purpose of recycling your processes after a set number of requests? Are you trying to avoid memory leaks, forcing your application to handle resets gracefully?

like image 249
Vytas Bradunas Avatar asked Dec 13 '15 19:12

Vytas Bradunas


People also ask

How many requests can uWSGI handle?

Running uWSGI in Async mode Each async core can manage a request, so with this setup you can accept 10 concurrent requests with only one process. You can also start more processes (with the --processes option), each will have its own pool of async cores.

Why do you need uWSGI?

uWSGI supports several methods of integrating with web servers. It is also capable of serving HTTP requests by itself. WSGI is just an interface specification, in simple terms, it tells you what methods should be implemented for passing requests and responses between the server and the application.

How many processes does uWSGI have?

The threads option is used to tell uWSGI to start our application in prethreaded mode. That essentially means it is launching the application across multiple threads, making our four processes essentially eight processes.

What is uWSGI params?

You can dynamically tune or configure various aspects of the uWSGI server using special variables passed by the web server (or in general by a uwsgi compliant client). For Nginx, the uwsgi_param <name> <value>; directive is used. For Apache, the SetEnv <name> <value> directive is used.


1 Answers

Yes, avoiding memory leak is one of the main reason of setting max request. There is also another parameter named harakiri which helps server get rid of bad application, locking the resources.

like image 114
Ali Nikneshan Avatar answered Sep 17 '22 20:09

Ali Nikneshan