Possible patch to cure CGI's not finding data for objects in status.dat

Andreas Ericsson ae at op5.se
Mon Aug 10 10:34:27 CEST 2009


Hiren Patel wrote:
> Cary Petterborg wrote:
>> I have one question and one observation in addition to what I already 
>> said....
>>
>> Question:
>> In the case of the web server and nagios being on the same system, how 
>> much is an fsync() really going affect the performance of the system? 
>> Can someone "quantify" the impact of a single fsync? (I guess that is 
>> technically a second question.) If it were to do a sync() (where all the 
>> open files are checked to ensure that they are sync'd) instead of an 
>> fsync(), I would definitely agree - much bigger impact. But, the single 
>> fsync at the end of writing a file should not be of any real 
>> significance, except in the case where it means that the data is 
>> actually there where it should be if it *is* done (e.g. my case).
>>
>>  
> 
> I tried a program which I meant to attach to this mail that I deleted by 
> mistake as I was composing this mail, that fopen'd a file, wrote a 
> character at a time and either fclosed at the end, or fsync'd after each 
> character, or sync'd after each character. it wrote 1MB worth of 
> characters to the file.
> 

Ahmm... That's not really such a great test, tbh. Try the write throughput
with a testing tool for it and then divide the size of the file to be
synced with the actual write speed of the disk and you'll get something
rather close to the cost of a single fsync call for a particular file.

> 
> not sure how useful this really is to get an idea, but sync is clearly 
> to be avoided as you mentioned. what do you guys make of the difference 
> between fsync and no fsync in relation to nagios?
> 

fsync() isn't needed when using a sane file system. When using an insane
one, there are no guarantees that fsync() works anyway, so why use it?

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july




More information about the Developers mailing list