Return-Path: X-Original-To: apmail-httpd-bugs-archive@www.apache.org Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42EBEDB61 for ; Tue, 21 May 2013 20:44:51 +0000 (UTC) Received: (qmail 67676 invoked by uid 500); 21 May 2013 20:44:51 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 67594 invoked by uid 500); 21 May 2013 20:44:51 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: "Apache HTTPD Bugs Notification List" List-Id: Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 67586 invoked by uid 99); 21 May 2013 20:44:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 May 2013 20:44:51 +0000 X-ASF-Spam-Status: No, hits=-1996.0 required=5.0 tests=ALL_TRUSTED,TO_NO_BRKTS_PCNT,URIBL_SBL X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 May 2013 20:44:48 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 471327DC0; Tue, 21 May 2013 20:44:27 +0000 (UTC) From: bugzilla@apache.org To: bugs@httpd.apache.org Subject: [Bug 55000] New: Memory usage per process doubles when Apache is compiled with --enable-pie Date: Tue, 21 May 2013 20:44:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Apache httpd-2 X-Bugzilla-Component: Core X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: darknovanick@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: bugs@httpd.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter classification Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=55000 Bug ID: 55000 Summary: Memory usage per process doubles when Apache is compiled with --enable-pie Product: Apache httpd-2 Version: 2.2.24 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Core Assignee: bugs@httpd.apache.org Reporter: darknovanick@gmail.com Classification: Unclassified I've been trying to track down why the same web pages running on one server use far less memory than another server. This process has lead me to eventually discover how a difference in how Apache is compiled has made a huge difference. The problem server is running CentOS (RedHat Enterprise clone) 5.9. gcc is version 4.1.2. php is 5.3.3 and I am using mod_php with Apache. httpd is running in prefork mode. My web application is Magento, which is a PHP application. I am running APC along with that. I have a test script that throws several thousands of URLs at the server. I am measuring httpd's memory usage with http://www.pixelbeat.org/scripts/ps_mem.py which takes into account shared memory. Slightly different but pretty close results can be found with the line: ps -ef | grep httpd | grep -v ^root | awk '{ print $2 '} | xargs pmap -d | grep ^mapped: | awk '{ print $4 }' | cut -dK -f1 | awk '{ SUM += $1} END { print SUM/NR }' For test purposes, I have httpd configured with MaxClients 10 and MaxRequestsPerChild 0 so that the memory problem appears more quickly. I first noticed this problem with CentOS's stock httpd, which is a patched version of 2.2.3, but I have reproduced it with 2.2.24 to eliminate the possibility that it has already been fixed. I compiled 2.2.24 with: ./configure --prefix=/tmp/httpd-install --enable-pie --enable-mods-shared=all --enable-ssl --with-ssl I let it run on my test URLs and after 1+ hours, it stabilizes on a memory usage of around 110 MB per process. At first I thought there was a problem with PHP, but further investigation found that PHP's memory usage was a small fraction of this usage per child. I started changing configure options and eventually found that compiling 2.2.24 with: ./configure --prefix=/tmp/httpd-install --enable-mods-shared=all --enable-ssl --with-ssl And running with the same URLs in a similar way, stabilizes on a memory usage of around 60 MB per process. This is 100% reproducible on this system, I have tried 2.2.3, 2.2.22 and 2.2.24. These particular figures come from a test that didn't have any non-Apache-provided modules enabled except for mod_php. I have tried playing with the --enable-pie option on a debian system, and have not been able to see much difference. On this redhat system, adding the --enable-pie option causes usage to about double, which is huge. On my actual production box, there can be over 100 child processes, and having each one with double the memory usage is a big problem. I have been researching the --enable-pie option and am at a loss as to why that would cause such a memory jump. I also do not know if another PHP application, or running httpd without PHP, would see the same memory doubling or not. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org