Skip to content

Instantly share code, notes, and snippets.

@j2labs
Created March 13, 2012 08:18
Show Gist options
  • Save j2labs/2027568 to your computer and use it in GitHub Desktop.
Save j2labs/2027568 to your computer and use it in GitHub Desktop.
1000 concurrent downloads: gevent vs multiprocessing cc1.4xlarge
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 2.014980793 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 6.96465492249 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 5.79786896706 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 1.47629785538 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 1.73595380783 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 2.13242602348 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 1.65409302711 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Multiprocessing:
Took 1.82931685448 seconds...
ubuntu@ip-10-17-167-43:~$ vi downloading_complete.py
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 5.2130188942 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.21397590637 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.58203887939 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 4.89094281197 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.24247407913 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.5157289505 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.59691905975 seconds...
ubuntu@ip-10-17-167-43:~$ ./downloading_complete.py
With Gevent:
Took 2.39316606522 seconds...
@apg
Copy link

apg commented Mar 13, 2012

So, what you're saying is that multiple processes are better! I guess, in reality, gevent is better on average, but the average is killed by the 6 second craziness for multiprocessing. Other statistics would be more informative, but I've lost interest.

@j2labs
Copy link
Author

j2labs commented Mar 13, 2012 via email

@j2labs
Copy link
Author

j2labs commented Mar 13, 2012

Well, multiple cores anyway. Multiple processes on limited cores did quite badly. Check out gevent vs. multiprocess on one core here: https://gist.github.com/2027506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment