New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiprocess+gevent + redis become slower #1147
Comments
Thanks for the report. Have you tried the same benchmark with prior versions of redis-py? Was the gevent version faster when testing in prior versions? |
I have the same issue, @631068264 did you solve it? |
You can solve the issue setting the "queue_class" param on the redis.BlockingConnectionPool using the Queue class provided by gevent
from gevent.queue import Queue There are multiple queues classes, choose the one you like most |
Wonderful. Glad someone figured out a workaround. Thanks @gabomasi |
Version: redis==3.2.0 gevent==1.4.0
Platform: py2.7 , CentOS Linux release 7.4.1708
Description:
This is the synchronous code finish time log , get data very fast.
more log about kline.zip
This is the asynchronous code finish time log , get data even cost more than 1 sec. Sometimes will cost 4 or 5 sec
My redis config
kwargs
is the connect info just host db port and password. When use redis, I will get the same redis instance by key fromredis_pools
My synchronous code
My asynchronous code I use
gevent.pool
in multiprocess to speed upThe important code just run the
run
functionThe text was updated successfully, but these errors were encountered: