Forum Moderators: phranque
I have a website that runs a cron job every hour or so. But, my hosts have warned me to remove the cron job since it causes excessive loads.
Changing hosts is one option. But, I prefer staying with the same hosts for other reasons. Could someone let me know if it is possible to host my cron job alone at a different host. What are the other ways to counter this problem?
Thanks
Could someone let me know if it is possible to host my cron job alone at a different host.
Depends on what it does. So, what does it do?
I'd also determine if your host has specifically identified your cron job as sucking up excessive resources, or simply have a policy against cron jobs. If the former, ask them if they can explain in more detail just what resources it is using excessively, and to what extent.
If it is simply hitting a URL then any server should be able to perform this act, it doesn't have to be the host server. If it is doing things with files on the server that require it to be running as a specific user that has write permissions then you will want it to be from the same box.
Perhaps you can look at the load that the cron is having on the server and you can ask your hosting company to revisit their request if you are able to optimize whatever process the cron is hitting to a point where they don't mind that it is running so often.
May I ask what the Cron is doing?
Thanks for your time. My cron job checks on a database of RSS feeds, and updates my page if there is an update on one of the RSS feeds.
So, basically, there is one PHP page that does this updation-check, and my cron job invokes this every hour. So, my question is can this cron job be invoked from elsewhere to run this PHP page of mine every hour?
So, my question is can this cron job be invoked from elsewhere to run this PHP page of mine every hour?
Certainly.
However, if the objection really IS resource usage, I would expect your hosting provider to still object, as running "cron" on a different computer won't change the resource usage. The resources are being used by the PHP script.
I think it's a good idea for those running a Linux-based website to also have a Linux machine at their home or office, since there to much synergy to be gained by doing so. You could easily set up a cron job on such a machine to do this - but, as I said above, this doesn't really solve your problem.
Another way not to solve your problem would be to install some "cron-like" package on Windows. (I don't have any suggestions, but I am certain that they exist.)