What is the optimal approach for executing a Python script continuously, 24 hours a day, and what is the best platform to use for this purpose?

Galergro

Well-known member
VIP MEMBER
Joined
Feb 16, 2017
Messages
213
Hello everyone, I have eight scripts that I need to run continuously for two months. In your opinion, which service is the most suitable for this task?

I'm not sure if PythonAnywhere allows for running only one script per web app, or if DigitalOcean can meet my requirements. Can you please advise me on the best option? Thank you.
 
The adequacy of a small VPS will ultimately rely on the specific script being used.
 
The adequacy of a small VPS will ultimately rely on the specific script being used.
Scripts are extremely straightforward, involving continuous posting on certain Instagram profiles around the clock.

Which VPS do you suggest? Alternatively, a cloud service like Replit and similar options may be suitable.
 
Feel free to choose any option that fits within your budget or that you know how to set up; simply proceed with that choice.
 
Feel free to choose any option that fits within your budget or that you know how to set up; simply proceed with that choice.
I am using a VPS with dual cores. On this VPS, I have set up VS Code, turned off automatic updates, and currently have my script running. Are there any potential problems I should anticipate? What measures can I implement to ensure my scripts don't halt unexpectedly?
 
I am using a VPS with dual cores. On this VPS, I have set up VS Code, turned off automatic updates, and currently have my script running. Are there any potential problems I should anticipate? What measures can I implement to ensure my scripts don't halt unexpectedly?
Is it possible to execute this in the terminal, or why use vscode instead?

 
I use a Raspberry Pi, which draws power from the USB port on my home router and is connected to the Ethernet port. It functions exceptionally well.
 
The most straightforward approach involves containerizing the scripts using Docker and executing them through Docker Compose. By including the "restart: always" or "restart: unless-stopped" attribute for each container in the Docker Compose file, the containers will automatically restart after script execution. This method also eliminates concerns about Python versions and virtual environments since everything is virtualized.

Regarding hardware options, you could consider obtaining an inexpensive VPS or even a Raspberry Pi 4.
 
Similar threads Most view View more
Back
Top Bottom