I cannot set cron time to less than 1 minute even on my dedicated server. I need it to run every 15 seconds because it calls betfair api and calculations are highly time dependent. Please advise.
If you need to call a job every 15 second, don't use cron. cron is designed for requesting jobs to be done much later.
Instead, after the parent finishes the job, sleep for 15 seconds then call the child script, then exits. The child script can do its job, sleep for 15 second then call the next script. Lather, Rinse, Repeat.
If your server doesn't have time limit, then you don't even need to spawn a child script. Just sleep ever 15 seconds, do your thing, sleep 15 second, do the next thing, and so on. A sleeping script doesn't consume CPU, though it do consume RAM. But that's better than cycling your host's PID; which might cause your host to go uneasy.
Cron only lets you run things as fast as once a minute.
What I would do is do the 15 second timings inside your script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With