Bug 623259 - New include() / require() method in PHP 5.3 severely hurts performance
New include() / require() method in PHP 5.3 severely hurts performance
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: php (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Joe Orton
BaseOS QE - Apps
: RHELNAK
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-11 13:55 EDT by Andreas Rogge
Modified: 2012-09-25 05:13 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-25 05:13:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
PHP Bug Tracker 63160 None None None 2012-09-25 04:11:58 EDT

  None (edit)
Description Andreas Rogge 2010-08-11 13:55:23 EDT
Description of problem:

somewhere in the changeset from php 5.2 to 5.3 the access pattern for include(), include_once(), require() and require_once() changed.
Especially php 5.3 is doing the same fstat() call three times for every included file.

Version-Release number of selected component (if applicable):
- any 5.3 -

How reproducible:
always

Steps to Reproduce:
1. install php 5.3
2. create a file test.php with "<?php include('test2.php') =>" in it
3. touch test2.php
4. run "strace php test.php" and see what happens for the include
  
Actual results:
many calls to lstat() and fstat()

Expected results:
only one fstat() call

Additional info:
See also:
http://bugs.php.net/bug.php?id=49383
http://www.mail-archive.com/php-general@lists.php.net/msg250615.html

We were actually hit by this bug when upgrading the php release on a webcluster (document root shared using gfs2). As the new php release does at least three times as much fstat() calls as 5.1.6 the load on the boxes immediately increased by 300% (from <= 10 to >= 30). Downgrading to php 5.2.14 fixed the issue.
I guess this isn't too bad for non-clustered filesystems, but as stat() has always been a bit slow on gfs doing it unneccessarily often means a severe performance hit.
Comment 2 RHEL Product and Program Management 2010-08-11 14:18:44 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 3 RHEL Product and Program Management 2010-08-18 17:27:38 EDT
Thank you for your bug report. This issue was evaluated for inclusion
in the current release of Red Hat Enterprise Linux. Unfortunately, we
are unable to address this request in the current release. Because we
are in the final stage of Red Hat Enterprise Linux 6 development, only
significant, release-blocking issues involving serious regressions and
data corruption can be considered.

If you believe this issue meets the release blocking criteria as
defined and communicated to you by your Red Hat Support representative,
please ask your representative to file this issue as a blocker for the
current release. Otherwise, ask that it be evaluated for inclusion in
the next minor release of Red Hat Enterprise Linux.
Comment 4 Suzanne Yeghiayan 2011-03-28 17:11:47 EDT
Since RHEL 6.1 External Beta has begun, and this bug remains 
unresolved, it has been rejected as it is not proposed as an 
exception or blocker.

Red Hat invites you to ask your support representative to 
propose this request, if appropriate and relevant, in the 
next release of Red Hat Enterprise Linux.
Comment 5 Remi Collet 2012-09-25 05:13:26 EDT
PHP upstream have closed the initial bug as "not a bug".

A new bug is open, and we will try to get this improved in a future PHP Version. But as this would require some interface breaks, it won't be possible to include it in older PHP Versions.

Notice: the use of an opcode cache, such as php-pecl-apc, slightly reduce the effect (only 2 "stat" calls, instead of 3 "fstat")

Note You need to log in before you can comment on or make changes to this bug.