Other stat and reread caching?

Hi there,

we come about the same problem on all our FreeBSD servers with ufs2/zfs compared to ext3/4 on a linux distro: The first access to a file/dir is more or less in the same speed, as the second read/access is if(!) it is within a very short time (about a second). After e.g. 10 seconds, the FreeBSD servers need to take the same time as the first read (and e.g. stat) and the linux system obviously fires out the content from cache. It takes more than a minute, before the ext3/4 file accesses seem to take the same time as on the first access.

Is there some sysctl/kernel/whatever tweak I can use to adjust this behavior? I can't believe that this difference is wanted as this makes the same applications/use cases more than slow compared to ext3/4 on linux :(

Any help is really welcome!!
Usually FreeBSD by default will record the access time (atime), whereas Linux seems not to.
That results in a metadata-write when reading the file for FreeBSD, which Linux doesn't bother with.
FreeBSD is POSIX compliant, Linux is not in this respect, if that matters.

You can add the noatime flag (see mount(8)) to your fstab(5) file to disable this functionality.

For example, a line like:

/dev/mirror/Musr /usr ufs rw 0 2

changed to

/dev/mirror/Musr /usr ufs rw,noatime 0 2

should do it.