From owner-freebsd-questions@FreeBSD.ORG Fri Nov 27 02:45:39 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 88EAF1065679 for ; Fri, 27 Nov 2009 02:45:39 +0000 (UTC) (envelope-from cronfy@sprinthost.ru) Received: from odin.from.sh (odin.from.sh [80.93.50.112]) by mx1.freebsd.org (Postfix) with ESMTP id 429508FC0C for ; Fri, 27 Nov 2009 02:45:39 +0000 (UTC) Received: from odin.from.sh ([80.93.50.112]) by odin.from.sh with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NDqpp-00063y-TN for freebsd-questions@freebsd.org; Fri, 27 Nov 2009 05:45:25 +0300 Received: from [194.8.176.106] (helo=[192.168.0.3]) by odin.from.sh with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NDqpi-00062t-DM for freebsd-questions@freebsd.org; Fri, 27 Nov 2009 05:45:18 +0300 Message-ID: <4B0F3D3B.9010109@sprinthost.ru> Date: Fri, 27 Nov 2009 05:45:15 +0300 From: cronfy User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: 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: Fri, 27 Nov 2009 02:45:39 -0000 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?