Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2C82932C for ; Wed, 16 Nov 2011 10:39:47 +0000 (UTC) Received: (qmail 4888 invoked by uid 500); 16 Nov 2011 10:39:47 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 4822 invoked by uid 500); 16 Nov 2011 10:39:47 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 4814 invoked by uid 99); 16 Nov 2011 10:39:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 10:39:47 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 10:39:39 +0000 Received: from [195.227.30.209] (notebook-rj [195.227.30.209]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id pAGAdJRl019786 for ; Wed, 16 Nov 2011 11:39:19 +0100 (CET) Message-ID: <4EC392D2.80808@kippdata.de> Date: Wed, 16 Nov 2011 11:39:14 +0100 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: setting TZ env var References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 15.11.2011 17:06, Paul Querna wrote: > So, I was looking at all the system calls we make in a single request, > and comparing it to nginx. > > We were actually pretty close, baring supporting our features like > htaccess, there was only one thing that stood out. > > Glibc is opening, calling fstat twice, and then reading /etc/localtime > for every request: > > [pid 31496] 0.000051 open("/etc/localtime", O_RDONLY) = 8<0.000014> > [pid 31496] 0.000041 fstat(8, {st_mode=S_IFREG|0644, st_size=118, > ...}) = 0<0.000011> > [pid 31496] 0.000048 fstat(8, {st_mode=S_IFREG|0644, st_size=118, > ...}) = 0<0.000010> > [pid 31496] 0.000048 mmap(NULL, 4096, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbd87efa000<0.000013> > [pid 31496] 0.000040 read(8, > "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., > 4096) = 118<0.000015> > [pid 31496] 0.000051 lseek(8, -62, SEEK_CUR) = 56<0.000011> > [pid 31496] 0.000034 read(8, > "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., > 4096) = 62<0.000011> > [pid 31496] 0.000048 close(8) = 0<0.000012> > > > One way to fix this, is to set the TZ environment variable. > > For example: > > > This specific patch has some issues, but is there any objections to > the concept of setting the timezone on process startup? Fine for me. > This single change gives about a 2% performance boost in my testing. > > To merge to trunk I'd like to have it detect your active timezone, > instead of forcing UTC+0, but if you changed timezones on your > machine, you will need to restart httpd. I'd say it is OK. I assume a "apachectl restart" would do? It should be expected for a long running daemon to signal it to adopt to environmental changes like the timezone. Regards, Rainer