I am new here, thank you for letting me register with your discussion club.
I am working on cluster monitoring and management and one of the functions is to periodically monitor I/O degradation with load.
My current monitoring script is shell based and ends up calling many processes, for disk I/O using the popular
but would like to replace with PHP implementation in effort to reduce process spawn and impact of monitoring solution on monitored container. Shell math is awkward and each expression or output scrap requires a process spawn.dd if=/dev/zero of=test_$$ bs=64k count=64 conv=fdatasync
I have this:
Code: Select all
$f = fopen($path, 'wb');
stream_set_write_buffer($f, 0);
for($i=0; $i<$count; $i++)
fwrite($f, $blk);
fflush($f);
fclose($f);
Is there a way to do a true unbuffered disk write in PHP with small files (say 16MB) or should I just stick with calling dd ? 1-2 processes is way better than calling hundreds of them every 5 minutes.
Thank you
Julia