Author Topic: how often must this cron be scheduled?  (Read 151 times)

solom

  • Active Member
  • **
  • Posts: 45
  • Karma: +0/-0
how often must this cron be scheduled?
« on: February 03, 2012, 12:53:14 PM »
Greetings

There is a cron job that is running on every hour in my shared hosting account. I think its related to my matriminial site..
Quote
/usr/bin/php -f /home/my-account/public_html/site-name/tools/cron/cron.php
I got a complaint from my host for high CPU time usage.
Is it that resource demanding?
Must that cron be run each hour? can I set it to run less frequently? once a week for example?
How will that affect the site?

Many thanks.

maverick

  • Active Member
  • **
  • Posts: 1382
  • Karma: +93/-1
    • Etano Templates
Re: how often must this cron be scheduled?
« Reply #1 on: February 03, 2012, 01:38:56 PM »
Actually the Etano cron jobs run at various intervals anywhere from every 5 minutes to once a month. Various tasks are spread out to run at various scheduled times to reduce the load.

You can't have all the tasks run once a week, unless when a new user signs up you want them to wait a week before their profile appears on the site and in the site's search results, or wait a week to receive site notifications about new messages, etc ... etc ... etc.

If you have a ton of members and a lot of activity going on, it can get a bit intense on server resources, especially on shared hosting where hundreds of sites are sharing the server's resources, in which case you may have to either upgrade your host plan or find another host.
Etano Templates and Mods

http://www.maverickwebworks.com

solom

  • Active Member
  • **
  • Posts: 45
  • Karma: +0/-0
Re: how often must this cron be scheduled?
« Reply #2 on: February 03, 2012, 02:14:58 PM »
Isn't that a bit unusual? having to run cron jobs for simple tasks like showing a new member's profile info on the site? Shouldn't that directly create new table cells, and then read from there?
I feel that Etano could have been written to be much easier on server resources.. don't you think?

maverick

  • Active Member
  • **
  • Posts: 1382
  • Karma: +93/-1
    • Etano Templates
Re: how often must this cron be scheduled?
« Reply #3 on: February 03, 2012, 03:10:37 PM »
On the contrary the cron jobs and Etano's cache system is designed to lighten the load on server resources. It may have been a bit lighter without it if you only planned on having a small site with a few hundred members, but if you have a real busy site that has thousands of members, it would put much more stress on resources without having and effective cron task and caching system, your site would eventually start to run real slow. This is a common complaint with even some commercial grade dating and SN scripts, once they have a ton of members the site eventually begins to run painfully slow.

Etano is a commercial grade script designed to handle the load of larger member based sites.

Cron jobs technically in most cases aren't all that resource intense, your host just doesn't like it because they often put very limited restrictions on how much resources each site can utilize, especially on cheap hosting plans where there may be several hundred others hosted on the same server who all share the resources.

The main purpose of the cron jobs is to spread the load of various tasks to reduce the strain on the server.
Quote
Isn't that a bit unusual? having to run cron jobs for simple tasks like showing a new member's profile info on the site? Shouldn't that directly create new table cells, and then read from there?
It's a bit too complex to try and explain how the cron and cache system works, even I only have a general idea how it's all tied together and functions.
« Last Edit: February 03, 2012, 03:26:54 PM by maverick »
Etano Templates and Mods

http://www.maverickwebworks.com