HelioHost Posted November 21, 2017 Posted November 21, 2017 Username: camverse, Server: Johnny, Main domain: camverser.heliohost.org Hi, I have a long running task (no more than 15M memory, negligible CPU usage) that I'd like to host on your servers. All I require is 12h/5d hosting with just an 'okay' uptime without the restrictions such as 'total bandwidth', 'CPU usage', 'memory usage', 'time limits' e.t.c. to have to worry about. I've placed the necessary files (including the only Python script called: 'main.py') in the 'cgi-bin' folder as stated elsewhere on the forum.How do I now execute the script without any SSH access? Am I required to build a PHP based web-page in order to access and execute my script? Additionally, there will be these dependencies that require installation:python-telegram-botrequests[security] Any help is appreciated!
Krydos Posted November 21, 2017 Posted November 21, 2017 As far as uptime goes it looks like you picked our lowest uptime server: Johnny. He's sitting at about 87% right now, but has had exceptionally bad uptime over the last 24 hours. I'd say 90-95% would be more normal. Ricky is our next best server that also supports python, and he is currently sitting at about 98% uptime. Since he's our newest server we've been tweaking and fine tuning him to get a little better uptime. We're hoping to get 99% soon. Tommy is our best server plan with 99.9% uptime most of the time. Let us know if Johnny is going to be insufficient for your needs and we can provide instructions on how to switch servers. We highly recommend setting your script up as a cron where at regular intervals as small as every 5 minutes you script is executed and then it ends, rather than an infinite loop. Since your script would be designed to run for a short period and then terminate there is a lot less chance of your script getting locked up and failing. We've had a lot of experience with people trying to run infinite loop scripts like that and they rarely work right. Let us know if you need any help setting up the cron to execute your script.
HelioHost Posted November 21, 2017 Author Posted November 21, 2017 Hi, thank you for your response. I believe we can discuss changing servers a little later perhaps. The 'main.py' script imports telegram.ext's Updater module which has the function of getting updates from Telegram messenger. It does not run on an infinite poop per se, it runs in this fashion: updater.start_polling() updater.idle() Therefore the process is more or less idle if it is not being sent an update to process. Stopping and starting the script every few minutes would not be viable for a responsive chat bot. I'd rather have a slow responsive bot than a bot that works every now and then. The only reason I'd use a cron job is if in case the server restarts and it does not launch my script automatically, the cron job would launch it again. Within the script I would set a domain socket lock to avoid duplicate processes so that even tho the process is always running and the cron job is always launching, there will only be one original process running at any given time. So how would I go about setting up a cron job?On Nov 21, 2017, at 5:02 AM, Heliohost Support wrote: As far as uptime goes it looks like you picked our lowest uptime server: Johnny. He's sitting at about 87% right now, but has had exceptionally bad uptime over the last 24 hours. I'd say 90-95% would be more normal. Ricky is our next best server that also supports python, and he is currently sitting at about 98% uptime. Since he's our newest server we've been tweaking and fine tuning him to get a little better uptime. We're hoping to get 99% soon. Tommy is our best server plan with 99.9% uptime most of the time. Let us know if Johnny is going to be insufficient for your needs and we can provide instructions on how to switch servers.We highly recommend setting your script up as a cron where at regular intervals as small as every 5 minutes you script is executed and then it ends, rather than an infinite loop. Since your script would be designed to run for a short period and then terminate there is a lot less chance of your script getting locked up and failing. We've had a lot of experience with people trying to run infinite loop scripts like that and they rarely work right. Let us know if you need any help setting up the cron to execute your script. You may view the status of your ticket by visiting: https://www.helionet.org/index/index.php?showtopic=30590 Thank you,Heliohost supporthttps://www.heliohost.org/https://www.helionet.org/
Krydos Posted November 21, 2017 Posted November 21, 2017 That makes sense about needing an infinite loop type script instead of a script that runs every 5 minutes. Perhaps this post with help you? https://www.helionet.org/index/topic/29129-python-script-behavior/?p=132451
Recommended Posts