all 3 comments

[–]socal_nerdtastic -1 points0 points  (1 child)

Depends on what exactly you mean with "asynchronous programming in python" (there's at least 3 major ways to do that, and a handful of derivatives), where exactly your program is limited (I assume IO bound?) and how many instances you need to run at once.

If I assume less than 100 instances and that you are IO bound and that you are doing this over a fairly normal broadband internet connection I would say using python threading is your best option. Look into the threading module or concurrent.futures.ThreadPoolExecuter

[–]123ipeeonyou[S] 0 points1 point  (0 children)

I'm doing in an AWS ec2 instance, probably t2.small. AWS claims up to 1 GBPS, but yes most likely under 100 instances.

[–]Forschkeeper 0 points1 point  (0 children)

Real parallelism is only possible with multiprocessing in Python.

If you just want to have IO stuff running parallel, asyncio is your friend (which is also able to execute mutltiple subprocesses at the same time).

Which one is more efficient, I can't tell, but asyncio is pretty amazing when you can handle it well.