Date: Mon, 30 Nov 2009 14:27:08 +0100 From: Ivan Voras <ivoras@freebsd.org> To: freebsd-questions@freebsd.org Subject: Re: 2 processes reproducible read same file with different speed Message-ID: <hf0h74$lm4$2@ger.gmane.org> In-Reply-To: <4B0F3D3B.9010109@sprinthost.ru> References: <4B0F3D3B.9010109@sprinthost.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
cronfy wrote: > Hello. > > I've noticed a very weird behavior of 2 Apache processes that shold read > the same file to process a request (they configured to read it on every > request). One spends about 6ms to read the file, and second spends about > 114ms (I used ktrace to find this out). Every time, on every request, > the problem is reproducible. Apaches are the same, the only difference > between them that they are working from different users to serve > different sites. Same binary, same config. > > First Apache used to work in the same way some time ago - it spent > ~120ms to read the file. But once it changed and now it is working fast. > > Restarts of Apache do not look to affect on anything. > > The file that Apache should read is 315k long. Apache reads it by small > blocks of 4096 bytes each. May be FreeBSD has some memory about how > process is working with files and after some time enables some > optimization or caching?.... I just do not have any clue... :( > > Can anyone explain this please? In addition to the other reply you got, there could also be a problem of different link speeds. If one user is connected by a slower link any you are doing blocking send()-after-read() operation, this will account for requests being processed at different speeds.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hf0h74$lm4$2>