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
12
votes
1 answer

SynchronousOnlyOperation from celery task using gevent execution pool

Given celery running with these options: celery -A openwisp2 worker -l info --pool=gevent --concurrency=15 -Ofair Given this celery task from openwisp-monitoring: @shared_task def perform_check(uuid): """ Retrieves check according to the…
nemesisdesign
  • 8,159
  • 12
  • 58
  • 97
12
votes
2 answers

How to pass the remote IP to a proxied service? - Nginx

I'm running a service in localhost at 127.0.0.1:8000 and I'm proxying this by using: proxy_pass http://127.0.0.1:8000; Problem is that I need to pass the user's IP address to the service. Any ideas?
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
12
votes
1 answer

How to profile Django on Gunicorn in production

I have a memory leak that is hard to reproduce in testing environment. So I'd like to profile my production server for a limited time period to get an overview about which objects take up most memory. It seems that it's not that easy to profile…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
11
votes
4 answers

disable request buffering in nginx

It seems that nginx buffers requests before passing it to the updstream server,while it is OK for most cases for me it is very bad :) My case is like this: I have nginx as a frontend server to proxy 3 different servers: apache with a typical php…
Uriel Katz
  • 187
  • 1
  • 2
  • 10
11
votes
1 answer

Can python abstract base classes inherit from C extensions?

It seems as if that when I have an abstract base class that inherits from gevent.Greenlet (which inherits from the C extension module greenlet: https://github.com/python-greenlet/greenlet) then classes that implement it do not raise any of the abc…
Dustin Wyatt
  • 4,046
  • 5
  • 31
  • 60
11
votes
3 answers

gevent-socketio + Flask + Gunicorn

Can I use gevent-socketio with Flask, running under Gunicorn, and still enjoy the nice exception printing, debugger, and reload capability that Flask offers? How would my gunicorn worker and WSGI app class look like?
Nitzan Shaked
  • 13,460
  • 5
  • 45
  • 54
10
votes
2 answers

Making Django go green

I have a Django management command that makes thousands of TCP/UDP requests. I've used Gevent to speed this up as I've restructured my code to work as coroutines. The socket connections no longer block but from what I've read, parts of Django still…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
10
votes
1 answer

ERROR: Could not build wheels for gevent, which is required to install pyproject.toml-based projects

I am using python 3.9. I tried to install a python package : pip.exe install gdbgui==0.13.2.0 But it gives me an error ERROR: Failed building wheel for gevent Failed to build gevent ERROR: Could not build wheels for gevent, which is required to…
Raj
  • 197
  • 1
  • 2
  • 11
10
votes
0 answers

Gunicorn With Gevent, Performance Gain

Gunicorn Worker Class Gunicorn has worker_class setting. Some possible values are sync gthread gevent Definitions from Luis Sena's nice blog sync This is the default worker class. Each process will handle 1 request at a time and you can use the…
Kagan Coskun
  • 341
  • 2
  • 10
10
votes
2 answers

Uwsgi with gevent vs threads

First of all, sorry for my bad English. In my project i have a lot of I/O network requests. Main data stored in another projects, and access is provided by web API (JSON/XML), polling. We use this APIs for each new user session (getting information…
OLMER
  • 117
  • 1
  • 1
  • 8
10
votes
1 answer

WebSockets and WSGI together through Gunicorn

Is it possible to use Gunicorn to handle WebSockets and regular WSGI views together in one (Flask) app? I know how to get websockets to work using the Gevent WSGI server, and I can get a regular WSGI app running with Gunicorn, with gevent workers,…
Moshe Bildner
  • 461
  • 5
  • 9
10
votes
4 answers

Python3: Looking for alternatives to gevent and pylibmc/python-memcached

So, I have decided to write my next project with python3, why? Due to the plan for Ubuntu to gradually drop all Python2 support within the next year and only support Python3. (Starting with Ubuntu 13.04) gevent and the memcached modules aren't…
Nadav
  • 168
  • 2
  • 10
10
votes
1 answer

minimal example of Python's bottle microframework using gevent-socketio and Socket.IO.js

Question: What would be a comparable solution to the example at this link, except implemented using gevent-socketio and Socket.io.js with bottle? I'm looking for the minimal solution that will simply pass some traffic in a loop from the client to…
Trevor
  • 1,613
  • 3
  • 22
  • 34
9
votes
2 answers

What's the best socket.io server for use with Django - gevent or tornadio2?

I'm working on a WebApp using backbone.js and socket.io on the client side, and Django on the server side. I'd like to do "push" from the server when data changes (just like in a chat app). I came across two implementation of socket.io in Python…
Tony Abou-Assaleh
  • 3,000
  • 2
  • 25
  • 37
9
votes
1 answer

How to set gunicorn worker number in a kubernetes' pod

I'm running a flask application with gunicorn and gevent worker class. In my own test environment, I follow the official guide multiprocessing.cpu_count() * 2 + 1 to set worker number. If I want to put the application on Kubernetes' pod and assume…
romlym
  • 561
  • 1
  • 7
  • 26