Reputation: 2737
I use openshift to run a script from time to time with the cron cartridge. however, as my application has no web activity (yet) it goes idle and my process doesn't run.
one could think of an ugly solution to generate fake web-load by using another service (such as ifttt to retrieve a page constantly but this sounds wrong.
could there be a better solution?
Upvotes: 15
Views: 5349
Reputation: 21
Bronze is free. All plans retain the free stuff, e.g. 3 free gears etc. you will only pay $0.02 hr on gears above 3. So if you are using the free tear and not using 3 gears you should be safe to upgrade to bronze and remain free.
Upvotes: 2
Reputation: 37
Openshift cartridge goes idle after 24 hours of inactivity.
Activity is considered receiving a Get request in your application originated outside your cartridge (so pinging your app from your own cartridge doesn’t work).
You can use any free pinging service to ping your application after a specific interval of time(< 24hrs).
You may use Pingdom. I have found success using it. It provides a nice dashboard and graphs of response time as well. You will be notified if there is any issues connecting to your app or if its down. You can manage your account with their mobile apps.
There are other free pinging services too. Feel free to Google and try out other services. Do comment if you find a good one, might be a great help for some :-).
Upvotes: 3
Reputation: 198
In your nodejs app:
In external page:
In this case:
Hope it helps someone.
EDIT: I'm sorry, it's not working anymore. No matter which kind of strategy you use, they will be able to discover systematic requests coming from a specific IP and exclude this situation, bringing your app idle for earn money, because everybody know that BRONZE is not FREE. It costs at least 0.02$/hour.
Upvotes: 0
Reputation: 10234
OpenShift will idle your application after 24 hours of inactivity1, but you can add an hourly cron job to your app to keep itself alive.
#!/bin/bash
PATH=/bin:/usr/bin:/usr/sbin
app_url=http://$OPENSHIFT_APP_DNS/
curl --insecure --location --silent --fail "$app_url" >/dev/null
Assuming your app isn't already idled and won't run the cron job :-)
1 Apparently the idle period used to be 48 hours before, but now it is 24 hours according to the OpenShift pricing table. In other words, a daily pinger cron job won't do it for you.
Upvotes: 4
Reputation:
It's not really a "trick" per se, but as long as you have consistent incoming traffic, your gear will not idle.
Upvotes: 2
Reputation: 2737
apparently the only way is to trick openshift to have out-coming traffic, I used a free account of https://www.site24x7.com for that
Upvotes: 8