eventlet

Fastest way to download 3 million objects from a S3 bucket

痴心易碎 提交于 2019-12-31 08:13:42
问题 I've tried using Python + boto + multiprocessing, S3cmd and J3tset but struggling with all of them. Any suggestions, perhaps a ready-made script you've been using or another way I don't know of? EDIT: eventlet+boto is a worthwhile solution as mentioned below. Found a good eventlet reference article here http://web.archive.org/web/20110520140439/http://teddziuba.com/2010/02/eventlet-asynchronous-io-for-g.html I've added the python script that I'm using right now below. 回答1: Okay, I figured out

Fastest way to download 3 million objects from a S3 bucket

霸气de小男生 提交于 2019-12-31 08:13:41
问题 I've tried using Python + boto + multiprocessing, S3cmd and J3tset but struggling with all of them. Any suggestions, perhaps a ready-made script you've been using or another way I don't know of? EDIT: eventlet+boto is a worthwhile solution as mentioned below. Found a good eventlet reference article here http://web.archive.org/web/20110520140439/http://teddziuba.com/2010/02/eventlet-asynchronous-io-for-g.html I've added the python script that I'm using right now below. 回答1: Okay, I figured out

error: command 'gcc' failed with exit status 1 while installing eventlet

蹲街弑〆低调 提交于 2019-12-27 10:48:11
问题 I wanted to install eventlet on my system in order to have "Herd" for software deployment.. but the terminal is showing a gcc error: root@agrover-OptiPlex-780:~# easy_install -U eventlet Searching for eventlet Reading http://pypi.python.org/simple/eventlet/ Reading http://wiki.secondlife.com/wiki/Eventlet Reading http://eventlet.net Best match: eventlet 0.9.16 Processing eventlet-0.9.16-py2.7.egg eventlet 0.9.16 is already the active version in easy-install.pth Using /usr/local/lib/python2.7

Celery + Redis - .get() hangs indefinitely after running smoothly for ~70 hours

依然范特西╮ 提交于 2019-12-24 00:54:46
问题 Everything runs fine for multiple days, but then I get an indefinite hang on .get(). The time it takes for the indefinite hang to occur varies, but it's between 24 and 72 hours of running. My suspicion is that this has something to do with the Redis broker. The output of CLIENT LIST in redis-cli shows a large number of connections with a very high idle number (see below). But I don't know if this is an issue or why this would cause Celery's .get() to hang indefinitely. I have confirmed that

`eventlet.spawn` doesn't work as expected

好久不见. 提交于 2019-12-17 19:54:46
问题 I'm writing a web UI for data analysis tasks. Here's the way it's supposed to work: After a user specifies parameters like dataset and learning rate , I create a new task record , then a executor for this task is started asyncly (The executor may take a long time to run.), and the user is redirected to some other page. After searching for an async library for python , I started with eventlet , here's what I wrote in a flask view function: db.save(task) eventlet.spawn(executor, task) return

Celery + Eventlet + non blocking requests

本小妞迷上赌 提交于 2019-12-17 19:20:19
问题 I am using Python requests in celery workers to make large number of (~10/sec) API calls(includes GET,POST, PUT, DELETE). Each request takes around 5-10s to complete. I tried running celery workers in eventlet pool, with 1000 concurrency. Since requests are blocking process each concurrent connection is waiting on one request. How do I make requests asynchronous? 回答1: Use eventlet monkey patching to make any pure python library non-blocking. patch single library # import requests # instead do

How to return to the main thread from a callback called on another thread

吃可爱长大的小学妹 提交于 2019-12-13 02:17:50
问题 I'd like to execute my code from a background callback into the main thread. For some reasons I didn't found simple examples to perform that. I found example with Queue and pooling, this is clearly not what I want. I just want to join the main thread in order to execute my function. Here is some simple code: def my_callback: # this callback is called from a third party and I don't have control on it. # But because of this, the function must_be_executed_on_main_thread is # executed on the

Is a greenthread equal to a “real” thread

吃可爱长大的小学妹 提交于 2019-12-12 10:46:48
问题 I've taken sample code from Unterstanding eventlet.wsgi.server. from eventlet import wsgi import eventlet from eventlet.green import time import threading def hello_world(env, start_response): print "got request", eventlet.greenthread.getcurrent(), threading.currentThread() time.sleep(10) start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello, World!\n'] wsgi.server(eventlet.listen(('', 8090)), hello_world) When I access the web server via different client ip addresses, I

Is eventlet 0.24.1 not compatible with any other configuration?

落爺英雄遲暮 提交于 2019-12-11 14:32:30
问题 The previous questions is here: The web-app is crashed when I deployed to Heroku but nothing is changed in the code All configurations, please see the previous questions. After I updated eventlet from 0.21.0 to 0.24.1, the error is happend below. Is eventlet 0.24.1 not compatible with any other configuration? Or what problem is this? $ heroku logs --tail --app main_project (node:11006) ExperimentalWarning: The fs.promises API is experimental ��� heroku-cli: update available from 6.12.8 to 6

how to fix python, urlopen error [Errno 8], using eventlet green

限于喜欢 提交于 2019-12-11 13:58:44
问题 Python novice here. I'm making a lot of asynchronous http requests using eventlet and urllib2. At the top of my file I have import eventlet import urllib from eventlet.green import urllib2 Then I make a lot of asynchronous http requests that succeed with this line: conn = urllib2.urlopen(signed_url, None) And all of a sudden, I get this error: URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known> This error occurs on the same urllib2.urlopen line, which is weird