Cron jobs
freshwire
12-12-2010, 11:59

Originally Posted by
MattTarquin
I take it that the 90 plan I am currently on does not offer any real support for any of these discussed solutions.
I would say the same for pretty much all shared hosting packages. While it would be possible to get it to work it could easily put un-fair stress on the server.
What kind of data would you be changing each time? Could it be coded another way?
MattTarquin
25-11-2010, 14:38
Thanks for passing this to your developers marks and thanks for the alternative options Iray.
I am quite reluctant to go down the custom server side service path as this is not the main focus of my project and I do not have the financial resources readily available to rent a private server. My technical knowledge is also not so strong on server side technologies such as "wget" or how to even setup a server side application. However if this looks like my only option then I will have to consider it.
I take it that the 90 plan I am currently on does not offer any real support for any of these discussed solutions.
I think MattTarquin is talking about the "Task scheduler" in the OVH manager. This is used to run a script located in your webhosting. But he's right, the script can be set to run every hour the most frequent.
I will be passing to our developers your request of having the scripts running more frequently, though not sure it'll be accepted. After all, scripts running more often than that could take too much of the CPU time of the webhosting server.
You can also try to set your script to sleep and so it runs every 5 minutes a wget.
Let us know your results. I'll let you know whether the developers find it possible to have the Tasks Scheduler modified.
You could have a server side application running wget to call the page which executes the SQL or have the application run the SQL command directly. You could loop the application and have it sleep for 2-4 seconds inside every loop, also have the loop recursive so it does not end until the process is killed manually.
Alternatively, on Windows, you should able to set a task scheduled using command line rather than the guinterface, you may be able to set the 0-5 second schedule this way.
On linux you can set a schedule to run every second if you wish using cronjobs.
MattTarquin
25-11-2010, 00:27
I am currently working on a multiplayer browser based game for a university project that runs in real time. For this I require that data on players and their accounts be kept up to date while they are not browsing the site.
To do this I wish to create a page of functionality that will interact with the SQL database and perform any tasks that need to be completed to ensure the game state is kept accurate. I then wish to call this page on a regular basis (once every 1-5 seconds) via a Cron job. I attempted to do this using the Task Scheduler, however this only offers periodicity in hours, I am looking for a much smaller time frame.
Could anyone offer a way of getting this set up or maybe an alternative solution to my problem?
I am on a 90 plan.
Many thanks,
Matt