Questions tagged [gevent]

Gevent is a coroutine-based Python networking library that uses greenlet to provide a high-level synchronous API on top of libevent (libev after 1.0) event loop.

Gevent is a coroutine-based Python networking library that uses greenlet to provide a high-level synchronous API on top of libevent (libev after 1.0) event loop.

1147 questions
30
votes
1 answer

Eventlet vs Greenlet vs gevent?

I'm trying to create a GUI framework that will have an event-loop. some threads to handle the UI and some for event handling. I've searched a little bit and found these three libraries and I'm wondering which one is better to use? what are the pros…
mehdy
  • 3,174
  • 4
  • 23
  • 44
29
votes
1 answer

redis-py with gevent

Can redis-py library be used with gevent ? Does anyone have experience running redis-py library with gevent? Is there a working example? Do they play nice together? Are there any precautions or hacks to get them to work at scale? The question in…
Joseph
  • 3,085
  • 3
  • 23
  • 33
28
votes
3 answers

Need help understanding Comet in Python (with Django)

After spending two entire days on this I'm still finding it impossible to understand all the choices and configurations for Comet in Python. I've read all the answers here as well as every blog post I could find. It feels like I'm about to…
XOR
  • 381
  • 5
  • 4
27
votes
5 answers

Gevent monkeypatching breaking multiprocessing

I am attempting to use multiprocessing's pool to run a group of processes, each of which will run a gevent pool of greenlets. The reason for this is that there is a lot of network activity, but also a lot of CPU activity, so to maximise my bandwidth…
user964375
  • 2,201
  • 3
  • 26
  • 27
26
votes
2 answers

Using gevent monkey patching with threading makes thread work serially

I am using gevent and I am monkey patching everything. It seems like the monkey patching causes the threading to work serially. My code: import threading from gevent import monkey; monkey.patch_all() class ExampleThread(threading.Thread): def…
yossi
  • 12,945
  • 28
  • 84
  • 110
26
votes
1 answer

Gevent multicore usage

I'm just started with python gevent and I was wondering about the cpu / mulitcore usage of the library. Trying some examples doing many requests via the monkeypatched urllib I noticed, that they were running just on one core using 99% load. How can…
thesonix
  • 3,200
  • 4
  • 20
  • 19
26
votes
1 answer

How to run gevent in production

I am making use of gevent in my Python application (Django based). However, I am now wondering how to run it in production. What server should I use? During development, I use gevent.pywsgi, but is that production-ready? I have also heard about…
Flavien
  • 7,497
  • 10
  • 45
  • 52
25
votes
3 answers

Python SSL connection "EOF occurred in violation of protocol"

I'm using Django Celery task to connect to Facebook Graph API with requests lib using Gevent. Issue I'm constantly running at is that every now and then I get EOF occurred in violation of protocol exception. I've searched around and various sources…
user962563
  • 495
  • 1
  • 4
  • 14
25
votes
3 answers

Which setup is more efficient? Flask with pypy, or Flask with gevent?

Both 'pypy' and 'gevent' are supposed to provide high performance. Pypy is supposedly faster than CPython, while gevent is based on co-routines and greenlets, which supposedly makes for a faster web server. However, they're not compatible with each…
hasen
  • 161,647
  • 65
  • 194
  • 231
24
votes
3 answers

Make a non-blocking request with requests when running Flask with Gunicorn and Gevent

My Flask application will receive a request, do some processing, and then make a request to a slow external endpoint that takes 5 seconds to respond. It looks like running Gunicorn with Gevent will allow it to handle many of these slow requests at…
JLTChiu
  • 983
  • 3
  • 12
  • 28
24
votes
4 answers

How to find out why uWSGI kill workers?

i have app on Pyramid. I run it in uWSGI with these config: [uwsgi] socket = mysite:8055 master = true processes = 4 vacuum = true lazy-apps = true gevent = 100 And nginx config: server { listen 8050; include uwsgi_params; location /…
Greg Eremeev
  • 1,760
  • 5
  • 23
  • 33
23
votes
5 answers

"RecursionError: maximum recursion depth exceeded" from ssl.py: `super(SSLContext, SSLContext).options.__set__(self, value)`

I am using Python 3.6.5 on the following remote server setup: Server: Windows 10 Python: 3.6.5 Requests: 2.18.4 Pentaho: 8.0 When I run request.get against URLs in the server's command prompt, it gets the JSON as expected: >>> import…
user3871
  • 12,432
  • 33
  • 128
  • 268
23
votes
2 answers

How to make Django work with unsupported MySQL drivers such as gevent-mysql or Concurrence's MySQL driver?

I'm interested in running Django on an async framework like Concurrence or gevent. Both frameworks come with its own async MySQL driver. Problem is Django only officially supports MySQLdb. What do I need to do to make Django work with the MySQL…
Continuation
  • 12,722
  • 20
  • 82
  • 106
23
votes
1 answer

Tornado/Twisted - Celery - Gevent Comparison

I'm having a bit of trouble understanding the differences between these three frameworks: Tornado/Twisted Celery Gevent These three frameworks can be used to run code at the same time but do this in different way using a different amount of…
arnoutaertgeerts
  • 2,232
  • 5
  • 29
  • 44
22
votes
1 answer

redis + gevent - Poor performance - what am I doing wrong?

I just wrote a simple piece of code to perf test Redis + gevent to see how async helps perforamance and I was surprised to find bad performance. here is my code. If you get rid of the first two lines to monkey patch this code then you will see the…
vivekv
  • 2,238
  • 3
  • 23
  • 37
1
2
3
76 77