-
I'm using pipeline and concurrent.futures.ThreadPoolExecutor . Any idea to get data faster? While doing hgetall on mass, CPU does not consume much Any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@pnthai88 This is not a issue but a question so moved it to discussions section. Basically i do not know of any other way of getting data faster then what you are doing, due to the huge amount of data you will hit some basic limitations just for the simple fact that converting 1000 values will take X ammount of time no matter what you do and allocating memory and converting things in python will just take time and with 2.7 mil records that will take time. However, i would not recommend that you use Threads for this kind of work, depending on what type of work you do with the data itself you should really look at multiprocessing instead of maximize the number of cores you can run in parallel to make fetching data possibly faster, threads are notorious for begin slow. In general whenever i see a thread like this or a question about threads or multiprocesses or similar topic i always recommend this talk (David Beazley - Python concurrency From the Ground Up: LIVE! - PyCon 2015) https://www.youtube.com/watch?v=MCs5OvhV9S4 as it is possibly one of the best talks ever and it deals with threads in a deeper way then anything out there. |
Beta Was this translation helpful? Give feedback.
@pnthai88 This is not a issue but a question so moved it to discussions section.
Basically i do not know of any other way of getting data faster then what you are doing, due to the huge amount of data you will hit some basic limitations just for the simple fact that converting 1000 values will take X ammount of time no matter what you do and allocating memory and converting things in python will just take time and with 2.7 mil records that will take time.
However, i would not recommend that you use Threads for this kind of work, depending on what type of work you do with the data itself you should really look at multiprocessing instead of maximize the number of cores you can run in parall…