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

CORS with gevent

I am building a gevent application in which I use gevent.http.HTTPServer. The application must support CORS, and properly handle HTTP OPTIONS requests. However, when OPTIONS arrives, HTTPServer automatically sends out a 501 Not Implemented, without…
sssilver
  • 2,549
  • 3
  • 24
  • 34
0
votes
2 answers

multiprocessing memory usage and twisted/gevents

so my... err... app does the following: listen on a queue for 'work' spawns about 100 workers per server (across ~3 servers), each listening on the queue each worker basically does some networky stuff (ssh, snmp etc) (i/o intensive), then churns…
yee379
  • 6,498
  • 10
  • 56
  • 101
0
votes
1 answer

gevent and twisted producer performance problems

I'm writing a minimal server to spit out a never ending stream of sensor data using twisted. The sensor data capture library uses gevent and an internal gevent.Queue to store the data that I'm serving up. For some reason, data is sent in a painfully…
4ZM
  • 1,463
  • 1
  • 11
  • 21
0
votes
1 answer

When do I need to use monkey_patch with gevent

I have a django app and I decided that I needed gevent so the webserver does not block on long connections. I am not using websockets - just a simple app. I can use gevent with gunicorn like so: gunicorn -k gevent -c config.py -b :9999 app:app In…
Trewq
  • 3,187
  • 6
  • 32
  • 50
0
votes
1 answer

python gevent import error

When I run an example of gevent, I get import error here. I am using macos, gevent is installed by pip. Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help",…
Vimos
  • 691
  • 1
  • 9
  • 23
0
votes
1 answer

How to catch/monitor/link gevent.sleep() exceptions

I'm using web2py for a project and found that gevent.sleep seems to hang in unexpected disconnects. I'm guessing this is due to improperly handled exception. I can not find it properly written into the documentation, how do I catch, link, or monitor…
Cenoc
  • 11,172
  • 21
  • 58
  • 92
0
votes
0 answers

gevent-socketio: “cannot import name core”

I have a Django project using gevent-socketio that runs fine with the manage.py runserver_socketio command in development mode. But I try to deploy it now on a web server (Apache) and I get this error: Traceback: File…
Vjeetje
  • 5,314
  • 5
  • 35
  • 57
0
votes
1 answer

Python: running process in the background with ability to kill them

I need to constantly load a number of data feeds. The data feeds can take 20-30 seconds to load. I know what feeds to load by checking a MySQL database every hour. I could have up to 20 feeds to load at the same time. It's important that non of the…
Jim
  • 1,337
  • 5
  • 20
  • 29
0
votes
1 answer

Install Grequests (stuck on gevent) mac OS 10.8

I try the last hours to install grequests on my mac 10.8. When I pip install it I get: $ pip install grequests Requirement already satisfied (use --upgrade to upgrade): grequests in…
Diolor
  • 13,181
  • 30
  • 111
  • 179
0
votes
0 answers

Python RQ losing data

We are using gunicorn + gevent on heroku, with our own hosted redis, and we are losing data at an average of 10 jobs for every 2000 jobs we put in. We have multiple points of redundancy and tracking, hence we are able to detect that the jobs did not…
laurenceputra
  • 317
  • 2
  • 5
  • 16
0
votes
2 answers

gevent using Queue get and socket recv at the same time

as the title mentioned example code: import gevent from gevent.queue import Queue class Worker(gevent.Greenlet): def __init__(self, sock): self.queue = Queue() self.sock = sock super(Worker, self).__init__() def…
Yueyoum
  • 2,823
  • 5
  • 23
  • 26
0
votes
1 answer

Deploying gevent in Django with mod_wsgi under Apache

It is working fine under Django's runserver with the monkey patch: if __name__ == "__main__": import gevent from gevent import monkey monkey.patch_all() execute_manager(settings) However, in production we are using Apache with mod_wsgi, and…
Goro
  • 9,919
  • 22
  • 74
  • 108
0
votes
1 answer

Celery worker with gevent pool + Sentry logger = hang

I'm using Celery with Django integration. I discovered some troubles with new commit to my current project: Celery worker with gevent pool refused to handle new tasks. After short investigation, I found that 'sentry' log handler cause a…
Artem Mezhenin
  • 5,539
  • 6
  • 32
  • 51
0
votes
1 answer

AttributeError: 'Socket' object has no attribute 'recv'

I'm trying to get this example(https://github.com/sontek/django-tictactoe/tree/master/small_tictactoe) for gevent-socketio running, but but I get this very strange error: Internal Server Error: /socket.io/1/websocket/49318546715 Traceback (most…
WhatIsName
  • 2,294
  • 4
  • 24
  • 36
0
votes
1 answer

How does a connection pool in MongoDB with pymongo driver?

I'm using mongodb with pymongo driver on gevent based framework. I don't understand working pool connection. I'm creating a new connection instance on every request: connection = MongoClient(host='localhost', port=27017,…
centum
  • 121
  • 1
  • 3
  • 8