On Fri, 16 Nov 2012 21:32:50 -0800 (PST), LBJ wrote:
> Hi all,
> I have question about timing and I/O. I am running a red hat version
of linux (forgot which version exactly, relatively recent)
You can see it with
cat redhat-release or maybe
cat /etc/release
> and have been timing programs I have written in a very
> straighforward way (ie getTimeOfDay at the beginning, getTimeOfDay
> at the end, subtract). I have noticed a lot of variability in the
> measurements I have been taking and I suspect it may be due to
> I/O. There is a lot of writing to file and socket communication
> going on, and there are other I/O intense processes running on the
> box in addition to the one I am timing. My questions are:
> 1) is it reasonable to assume that it is the i/o that is introducing
> a lot of timing variability from run to run
> 2) if so, how can I (easily) prove it?
First you might want to run "top" just to see what is going on.
Next I would suggest you using "time" to get a more detailed idea of
what may be going on.
Do keep in mind there are hourly cron jobs, which you might want to
avoid. If box is not up 24/7 then anacron might be running jobs which
did not execute when the box was powered off.
cat /etc/crontab to see actual times for jobs when system is up
24/7. If no up 24/7 you could have nightly jobs running while you are
logged in.