Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance running multiple Python scripts simultaneously

Tags:

python

Fairly new 'programmer' here, trying to understand how Python interacts with Windows when multiple unrelated scripts are run simultaneously, for example from Task Manager or just starting them manually from IDLE. The scripts just make http calls and write files to disk, and environment is 3.6.

Is the interpreter able to draw resources from the OS (processor/memory/disk) independently such that the time to complete each script is more or less the same as it would be if it were the only script running (assuming the scripts cumulatively get nowhere near using up all the CPU or memory)? If so, what are the limitations (number of scripts, etc.).

Pardon mistakes in terminology. Note the quotes on 'programmer'.

like image 728
Joseph Rhodes Avatar asked Jun 17 '26 04:06

Joseph Rhodes


1 Answers

how Python interacts with Windows

Python is an executable, a program. When a program is executed a new process is created.

python myscript.py starts a new python.exe process where the first argument is your script.

when multiple unrelated scripts are run simultaneously

They are multiple processes.

Is the interpreter able to draw resources from the OS (processor/memory/disk) independently?

Yes. Each process may access the OS API however it wishes, to the extend that it is possible.

What are the limitations?

Most likely RAM. The same limitations as any other process might encounter.

like image 69
Pedro Rodrigues Avatar answered Jun 19 '26 18:06

Pedro Rodrigues



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!