Questions tagged [eventlet]

a concurrent networking library for Python that provides performance and scalability of non-blocking IO while writing simple blocking code (no callbacks) using green threads.

It uses epoll or kqueue or libevent for highly scalable non-blocking I/O. Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O. The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application. It's easy to get started using Eventlet, and easy to convert existing applications to use it. Start off by looking at examples, common design patterns, and the list of the basic API primitives.

License: MIT.

http://eventlet.net/

311 questions
3
votes
1 answer

Celery eventlet worker threads using too many database connections

I have 2 celery workers which pool via eventlet, config is below: celery multi start w1 w2 -A proj -l info --time-limit=600 -P eventlet -c 1000 When running more than 100 tasks at a time, I get hit by the error: OperationalError: FATAL: …
Leb
  • 117
  • 1
  • 9
3
votes
1 answer

How is eventlet tpool useful?

I am trying to understand what eventlet.tpool is useful for. The docs say that tpool.execute() lets you take a blocking function and run it in a new thread. However, the tpool.execute() method itself blocks until the thread is complete! So how is…
Marc
  • 3,386
  • 8
  • 44
  • 68
3
votes
0 answers

Python + WSGI + Eventlet Websockets (100% CPU)

I am currently working with WSGI, Eventlet and REDIS to create a websocket server. We are seeing a very high CPU load for what I would expect with the number of connections. We have around 2000 connections to the websocket server which push…
Thomas
  • 65
  • 6
3
votes
2 answers

Django Celery Eventlet - Getting "No address found" error

I am currently using celery default prefork for concurrency and I want to use Eventlet. I tried to install Eventlet and used it for concurrency, but I am getting following error: [2017-01-01 04:11:14,233: ERROR/MainProcess] consumer: Cannot connect…
Vinod Ronold
  • 93
  • 1
  • 7
3
votes
1 answer

Is it safe to inject context into a eventlet thread like this?

I need to inject thread level context information for logging and debugging purposes. I've been told that this is potentially unsafe. greenthread = worker_pool.spawn(run_worker, args, handle_result) # this logging_context attribute will be accessed…
user916367
3
votes
1 answer

Using maxtasksperchild with eventlet

We have a python application with some celery workers. We use the next command to start celery worker: python celery -A proj worker --queue=myqueue -P prefork --maxtasksperchild=500 We have two issues with our celery workers. We have a memory…
KLIvan
  • 71
  • 3
3
votes
1 answer

Python SocketIO emitting event after server creation

I have a web project using php and a python script which modifies folders. I want to execute some javascript on the website based on eg. a folder creation done in the python script. My idea was to work with python socketio. I have the basic…
rambii
  • 451
  • 4
  • 11
3
votes
1 answer

Python Eventlet spawn not working

import eventlet def foo(): print('foo') def main(): eventlet.monkey_patch() pool = eventlet.GreenPool() pool.spawn(foo) if __name__ == "__main__": main() Expectation: foo But nothing happens, no print's. Why is this…
conquester
  • 1,082
  • 2
  • 21
  • 44
3
votes
2 answers

How can I raise Exception using eventlet in Python?

I have a simply code: import eventlet def execute(): print("Start") timeout = Timeout(3) try: print("First") sleep(4) print("Second") except: raise TimeoutException("Error") finally: …
Bazaka Bazaka
  • 135
  • 11
3
votes
1 answer

Why doesn't eventlet GreenPool call func after spawn_n unless waitall()?

This code prints nothing: def foo(i): print i def main(): pool = eventlet.GreenPool(size=100) for i in xrange(100): pool.spawn_n(foo, i) while True: pass But this code prints numbers: def foo(i): print i def…
Wilence
  • 343
  • 2
  • 3
  • 8
3
votes
1 answer

how to get python eventlet stack throuth gdb

I have a python program. It has many eventlet coroutine. It seems that the program have dead lock someday. I have dumped its memory. I want to find reason. The question is how to get eventlet coroutine stack using gdb. Additional Information: I…
xhzhf
  • 31
  • 1
3
votes
2 answers

Using eventlet.corolocal with Celery

Does anyone have experience using eventlet.corolocal, especially with celery (with eventlets for workers)? If so, could you shed some light on what's wrong with the below code sample? ... from eventlet.corolocal import local ... ev_local =…
Rohit Atri
  • 231
  • 1
  • 10
3
votes
1 answer

what does greenthread.sleep do?

I'm pretty new with eventlet and have some questions on sleep() I tested with a small piece of code. At first I spawned 3 greenthreads and then called greenthread.sleep(0), then these 3 greenthreads all came to execute the functions in them. what's…
3
votes
1 answer

eventlet.greenthread.sleep VS time.sleep in monkey-patched environment

We're running a server on eventlet green-threads + monkey-patching everything. I need to implement wait loop with periodic check, and I want to put sleep inside. Is there any difference between : eventlet.greenthread.sleep(1) AND time.sleep(1) in…
Max Lobur
  • 5,662
  • 22
  • 35
3
votes
1 answer

Fabric fails with Name lookup failed when celery is run with eventlet

I have a celery task to run a sudo command on a remote machine using fabric: @app.task(soft_time_limit=600) def run_puppet_agent(hostname): try: fabric_client = Fabric(hostname) result = fabric_client.run_command('puppet agent…
Uday
  • 653
  • 2
  • 6
  • 15