php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59319 Huge Apache (Prefork) Processes
Submitted: 2010-07-23 00:16 UTC Modified: 2016-08-31 15:35 UTC
From: mcs at sunwave dot net Assigned: cmb (profile)
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.2 OS: FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mcs at sunwave dot net
New email:
PHP Version: OS:

 

 [2010-07-23 00:16 UTC] mcs at sunwave dot net
Description:
------------
FreeBSD 7.2 (64bit), Apache 2.2.15, PHP 5.3.2, APC 3.1.3p1

Everything installed via FreeBSD ports system

'./configure' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--program-prefix=' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd7.2'

APC is set to use 256mb ram - that shows up fine (366mb)under the "SIZE" column in 'top'. That is shared amoung all apache processes.

The problem is in the "RES" column - each apache process grows from 25mb to almost 100mb *each* after just a few pageviews on my website. It doesn't appear to grow any larger than that.







Reproduce code:
---------------
Enable APC in the php.ini file


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-23 00:21 UTC] rasmus@php.net
Why do you think that has anything to do with PHP?  A large 
mysql query or anything that takes a lot of memory is going to 
grow that memory footprint in each process.
 [2010-07-23 00:28 UTC] mcs at sunwave dot net
Is this not the place to submit bug reports for APC? I'm confused by your first comment.

My apache processes *never* grow any larger than 25mb each with APC disabled.

With APC enabled, they grow to 100mb each within a few pageviews. It's obviously a bug somewhere within APC.
 [2010-07-23 00:33 UTC] rasmus@php.net
APC doesn't allocate huge chunks of ram like that.  Run your 
process in gdb or Valgrind and track down where these allocs 
are coming from in your app.
 [2010-07-23 01:09 UTC] mcs at sunwave dot net
I'm not familar enough with FreeBSD to even attempt anything like that. This is a production box that runs a couple websites.

Even if I was sucessful, I wouldn't know how to interpret the results. Please leave this open for comments and I'll just hope someone with a similar rig can shed some light on why this is happening.

I still believe this is an APC issue. It *never* happens with APC disabled. It *only* happens when APC is enabled.
 [2010-07-31 18:58 UTC] kalle@php.net
Hi

If you are able to get the results and post them here we can interpret them and figure out whether this is an APC issue or not :)
 [2010-07-31 21:03 UTC] mcs at sunwave dot net
If I use GDB to monitor a already running httpd process, what args would you like me to use?
 [2016-08-31 15:35 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2016-08-31 15:35 UTC] cmb@php.net
According to <https://bugs.php.net/69618>, APC support has been
discontinued in favor of OPcache, APCu, the session upload
progress API and WinCache. Therefore this issue won't get fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 19:01:30 2024 UTC