[CentOS] Event scheduling

Fri Feb 16 23:02:34 UTC 2007
Les Mikesell <lesmikesell at gmail.com>

John Summerfield wrote:
> Les Mikesell wrote:
>> Frank M. Ramaekers wrote:
>>> Sure I understand that, but If I wanted it to be within 15 seconds
>>> response, I'd have to check 4times x 60 seconds x 60 minutes x 24 hours
>>> per day.  Kind of a waste for a file that may or may not be transmitted
>>> each day.
>>
>> Usually any machine that can handle actually doing a job will have no 
>> problem with the work checking and not doing it the rest of the time...
>> If you are concerned about it, a stat() is pretty cheap compared to 
>> starting a program to do it, so you might write a long-running program 
>> to monitor for a new file or a timestamp change instead of starting 
>> one every few seconds.  If you really want a file-event driven 
>> interface you might look at dazuko.  http://www.dazuko.de/faq.shtml
>>
> 
> 
> That's not a very good thing to do in a virtual machine (by way of 
> example). Contemplate doing this in a zSeries box where there are likely 
> 100 or more virtual machines.

If a stat() every 15 seconds causes a problem, even with hundreds of 
them running at once you need to look for a different machine. Since you 
are doing it frequently the inode in question will be in cache and this 
will be a very lightweight operation.

-- 
   Les Mikesell
    lesmikesell at gmail.com