Answer the question
In order to leave comments, you need to log in
What is the correct way to enable lazy-apps option in uwsgi to use fork() in code?
Hi all!
Can anyone tell me what to do with this problem?
I use Debian + Nginx + Django + UWSGI,
in the view one of the functions does a fork (), another process forks, there are no problems with it, after that it immediately follows return render(request, ...
The problem is that after the branch the page does not load immediately, there is a long load and everything ends error "The web page is not available", while if I just update it quickly, it loads normally, since the branch is no longer created (the button on the form is not pressed).
The UWSGI documentation has this -
uWSGI tries to (ab)use the Copy On Write semantics of thefork()
call whenever possible. By default it will fork after having loaded your applications to share as much of their memory as possible. If this behavior is undesirable for some reason, use thelazy-apps
option. This will instruct uWSGI to load the applications after each worker'sfork()
. Beware as there is an older options namedlazy
that is way more invasive and highly discouraged (it is still here only for backward compatibility)
lazy-apps: 1
in my uwsgi.yaml . Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question