Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python simultaneously worker launch #832

Open
TheFatal opened this issue Jan 26, 2023 · 7 comments
Open

python simultaneously worker launch #832

TheFatal opened this issue Jan 26, 2023 · 7 comments

Comments

@TheFatal
Copy link

Is it possible to launch python workers simultaneously like uwsgi or gunicorn does ?
In current state when i set for example:
processes: 60
unit starts workers one after another after another etc, so it takes more than 10 minutes for my app

@tippexs
Copy link
Contributor

tippexs commented Jan 27, 2023

Hi @TheFatal atm this is the way it is / was implemented but we are sure there is some space for improvement. I will flag this as an enhancement and chat with our engineering team about it and update this issue as we go.

Are you available for testing any patches we will come along with?

@tippexs tippexs added the z-enhancement ⬆️ Product Enhancement label Jan 27, 2023
@TheFatal
Copy link
Author

thanks tou for the reply, for sure i can test some patchs on my app

@micaelmalta
Copy link

Same issue on our end.

It also cause some issues for some benchmark testing: TechEmpower/FrameworkBenchmarks#8059

@joanhey
Copy link

joanhey commented Mar 24, 2023

Possibly related to #794.

@micaelmalta
Copy link

@tippexs any news on this issue?

@tippexs tippexs added z-needs Investigation 🔬 and removed z-enhancement ⬆️ Product Enhancement labels Dec 6, 2023
@tippexs
Copy link
Contributor

tippexs commented Dec 6, 2023

Hi @micaelmalta sorry for the late response! Some things have changed on our end but I am happy to be back on things :)

So what you are saying is basically that IF the Unit configuriation is like "processes": 60 it will take minutes to start / restart Unit and the application processes? We will investigate this and I will also check the TechPower Bench. Sorry for letting this falling of my radar. Will keep you posted

@tippexs tippexs self-assigned this Dec 6, 2023
@ac000
Copy link
Member

ac000 commented Dec 6, 2023

The way it works is that for each application we start a prototype process, this is then used to fork(2) off however many application processes are required. fork(2) (on Linux at least) is a pretty quick operation, say single digit ms, see for example my comment here where I started up 84 PHP application process in short order.

Here I start 60 (albeit minimal) Python application processes.

2023/12/06 19:53:42 [info] 4325#4325 router started
2023/12/06 19:53:42 [info] 4326#4326 "python" prototype started
2023/12/06 19:53:42 [info] 4327#4327 "python" application started
...
2023/12/06 19:53:43 [info] 4386#4386 "python" application started

@TheFatal (or anyone else) Could you confirm what OS you are using?

Could you also provide a clean unit.log (make sure debugging is OFF) from when starting your application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants