From owner-freebsd-questions@FreeBSD.ORG Mon Nov 30 13:30:05 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D591065692 for ; Mon, 30 Nov 2009 13:30:05 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 5D4528FC15 for ; Mon, 30 Nov 2009 13:30:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NF6KJ-0002uF-Sa for freebsd-questions@freebsd.org; Mon, 30 Nov 2009 14:30:03 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Nov 2009 14:30:03 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Nov 2009 14:30:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ivan Voras Date: Mon, 30 Nov 2009 14:27:08 +0100 Lines: 27 Message-ID: References: <4B0F3D3B.9010109@sprinthost.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) In-Reply-To: <4B0F3D3B.9010109@sprinthost.ru> Sender: news Subject: Re: 2 processes reproducible read same file with different speed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 13:30:05 -0000 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.