php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63353 APC opcode size/memory use under PHP 5.4 is radically lower than 5.3 ?
Submitted: 2012-10-25 01:44 UTC Modified: 2012-12-10 00:53 UTC
From: ck+php dot net at bbshowcase dot org Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.4.8 OS: CentOS 6.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ck+php dot net at bbshowcase dot org
New email:
PHP Version: OS:

 

 [2012-10-25 01:44 UTC] ck+php dot net at bbshowcase dot org
Description:
------------
I am not sure this is a bug, in fact it looks like a great feature, but I am concerned it may be too good to be true.

The amount of memory being reported by APC in use and the total file size per directory group is radically lower under PHP 5.4 vs 5.3

We have a production server with around 1000 files being loaded into APC and under PHP 5.3, the APC memory use was around 150 megabytes

After switching to 5.4 (recompiling APC 3.1.13 and passing all tests) the APC memory use dropped to 100 megabytes after the same files loaded. That's a 33% reduction ?!

Server operation is normal and cache reports virtually the same number of files loaded and proper status, uptime of many hours without any problems. We only use memory for the cache and not disk swap. APC is only used for code cache and not user variable cache.

There is only one difference I can think of in that we can no longer run suhosin under PHP 5.4 because it is no longer compatible.

Might suhosin have bloated the opcode size or is PHP 5.4 that much more efficient or is APC reporting sizes incorrectly? Or is there another behavior change under PHP 5.4 I am not aware of?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-25 09:51 UTC] gopalv@php.net
Most importantly, the interned strings in PHP makes sure that once a string 
makes it into the interned pool, it is never again copied, but merely 
referenced.

Along with that, a lot of the bloat associated with classes has come down 
significantly. A lot of the properties, functions & such got moved from using 
hashtables to using fixed size arrays. This not only benefits classes, but the 
overhead per-object has also come down in 5.4. 

All that should add up to significant saving when you have a lot of classes & 
all the properties are declared in the classvars.
 [2012-12-10 00:37 UTC] Terry at ellisons dot org dot uk
Not a bug, but a feature. See the PHP wiki page https://wiki.php.net/rfc/performanceimprovements for more info.
 [2012-12-10 00:53 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-12-10 00:53 UTC] rasmus@php.net
Suhosin would have added more runtime memory but I don't think it would have 
affected the op_array sizes in shared memory. The reduced shared memory usage is 
just optimizations in PHP/APC in 5.4.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC