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

gunicorn 19.9.0 async with eventlet not work? #2179

Closed
gangm opened this issue Nov 18, 2019 · 6 comments
Closed

gunicorn 19.9.0 async with eventlet not work? #2179

gangm opened this issue Nov 18, 2019 · 6 comments

Comments

@gangm
Copy link

gangm commented Nov 18, 2019

I use gunicorn 19.9.0 + flask to test app:
app.py:

from flask import Flask
import time
app = Flask(__name__)

@app.route('/')
def index():
    print("in")
    for i in range(10):
        time.sleep(1)
    print("out")
    return 'hello world'

if __name__ == '__main__':
    app.debug = True
    app.run()

and boot cmd:
gunicorn -k eventlet -w 1 app:app --log-level=debug

test cmd:
curl localhost:8000

I think app can process multi requests at one time, but the test result is that app can only process 1 request at one time, and block in time.sleep()!

Is that gunicorn 19.9.0 can not work as async mode?

I attempted to use gunicorn 20.0.0, and there is no problem with async mode, but another problem occurs, --> #1559.
Now i have no idea which to use, gunicorn 19.9.0 or 20.0.0 ? (in our project, we use eventlet)

@jamadden
Copy link
Collaborator

eventlet is not monkey-patched in gunicorn 19.8 and 19.9; that's issue #1847 and was also pointed out in this thread. gunicorn 20 has an issue with sendfile using both gevent and eventlet that affects some people serving static content; that's been fixed in master.

Depending on your situation, there are a number of options. You could try using a different worker, for example gevent. Or you could try using a different gunicorn version, even potentially master. You could also try doing the monkey-patching yourself as described in #1559.

@averes-avidid
Copy link

Glad to know the static file thing has been fixed. This drove me crazy trying to figure out what was causing this. Well now I know why we should specify our versions in Pipfile/requirements.txt. When will this fix be pushed to PyPI?

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 21, 2019

Milestone for 20.0.1 here: https://github.com/benoitc/gunicorn/milestone/18

@benoitc
Copy link
Owner

benoitc commented Nov 22, 2019

@tilgovi @jamadden i has this feature been merged in 19.x also?

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 23, 2019

20.0.2 is released.

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 23, 2019

Also merged into 19.x as 253bfa1 and is in the 19.10 release.

@tilgovi tilgovi closed this as completed Nov 23, 2019
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