-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
workers problem #203
Comments
I actually have a similar problem and I'm not even changing the event loop. I tried the example from the documentation and set the workers to 4:
When I start it, it logs that it is spawning 4 workers, which it does:
But when I use wrk specifying 100 connections and 100 threads, still only one of the processes is handling the requests:
Sanic version 0.1.8. |
here is mine:
result:
it worked well. but when i change it to:
result:
only one works well ,other three processes never spawn. logs as below:
|
Same here on macOS ,
it says
but
|
Here is mine on MacOS 10.11.6 with explicit loop:
Output:
Another try with explicit uvloop:
output:
My environment:
virtualenv:
Worked fine without explicit loop, like:
output:
|
I guess libuv can't simple use with
work perfect, and visit /hello, the stdio output |
@neoblackcap the output shows no errors but I suspect that the additional workers are not being used, since there is no performance gain when you benchmark it with |
@marcosfede I rerun the test by you without here is my code:
test method stdio output
|
Yes I'm noticing the same behavior as well, currently investigating although I think it would be better to just abandon the multiple workers implementation once we make Sanic WSGI compliant as pointed out in #250, so we can use Sanic with gunicorn, uwsgi, etc and use their multiple workers implementations. |
@seemethere, how are you running multiple workers? |
I wonder if the issue is that different process can't share same uvloop.
My environment
|
I believe this was fixed with #276, if it hasn't I'll reopen the issue. |
I believe this issue still exists on master. Try the reproduction steps to my comment in #594 |
use |
if i use custom event loop below:
loop = uvloop.new_event_loop()
and then:
app.run(workers=4, loop=loop)
log will be:
2016-12-21 20:34:56,993: INFO: Spinning up 4 workers...
python: src/unix/linux-core.c:336: uv__io_poll: Assertion `(unsigned) fd < loop->nwatchers' failed.
and actually just 1 cpu core is working...
but when use default loop.
workers=4 will work.
os: ubuntu16.04 x64 and python 3.5.2
why?
The text was updated successfully, but these errors were encountered: