Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Rasmus Lerdorf
On 6/23/10 12:38 PM, Stas Malyshev wrote:
> Hi!
> 
>> But sadly not usable with common apps or frameworks as it will break
>> very easily.
>>
>> That's fixable (userland) but painful.
> 
> I didn't mean the stat call but rather the open call which precedes
> include_once. stat is a separate issue.

APC works around the open call by replacing the opcode handler.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Stas Malyshev

Hi!


But sadly not usable with common apps or frameworks as it will break
very easily.

That's fixable (userland) but painful.


I didn't mean the stat call but rather the open call which precedes 
include_once. stat is a separate issue.

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Pierre Joye
But sadly not usable with common apps or frameworks as it will break very
easily.

That's fixable (userland) but painful.

On 23 Jun 2010 20:44, "Rasmus Lerdorf"  wrote:

On 6/23/10 11:40 AM, Stas Malyshev wrote:
> Hi!
>
>> Another option may be to compute a hash of the...
APC does the same if you set apc.stat=0 to not check for file modifications.

-Rasmus


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/...


Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Rasmus Lerdorf
On 6/23/10 11:40 AM, Stas Malyshev wrote:
> Hi!
> 
>> Another option may be to compute a hash of the file.  When you find
>> that file content has the same hash value as a known file you flag
>> them as "same file".  This could be faster (file contents are cached
> 
> First, two files with the same content is not the same as same file
> referred twice with different name. Second, to know that I'd need to
> open and read the whole file and then compute the hash of it - which
> sounds quite expensive. Right now with proper caching non-including
> include_once can be done with 0 system calls (unfortunately, pure PHP
> doesn't do it yet, though IIRC Zend's Optimizer+ does - not sure about
> APC).

APC does the same if you set apc.stat=0 to not check for file modifications.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Stas Malyshev

Hi!


Another option may be to compute a hash of the file.  When you find
that file content has the same hash value as a known file you flag
them as "same file".  This could be faster (file contents are cached


First, two files with the same content is not the same as same file 
referred twice with different name. Second, to know that I'd need to 
open and read the whole file and then compute the hash of it - which 
sounds quite expensive. Right now with proper caching non-including 
include_once can be done with 0 system calls (unfortunately, pure PHP 
doesn't do it yet, though IIRC Zend's Optimizer+ does - not sure about 
APC).



in main memory because the OS already knows the files are the same,
and finding the "real" name of a file is a slow process).


It's only slow process once, then it's cached. And I'm not sure it's 
faster to load all the file into memory then check it's path.

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Wietse Venema
Rasmus Lerdorf:
[ Charset ISO-8859-1 unsupported, converting... ]
> On 6/23/10 6:56 AM, Wietse Venema wrote:
> > Stas Malyshev:
> >> Hi!
> >>
> >>> could anybody tell me why also for every single php file engine must lstat
> >>> all path?
> >>> Why php engine don't simply try to open directly the file?
> >>
> >> There are some places where PHP engine has to know "true" name of the 
> >> file - i.e. filename that would be the same for each file regardless of 
> >> how it is accessed - through relative path, symlinks, etc. Example can 
> >> be {include|require}_once. For that, it needs to figure out the whole 
> >> path. It is done only once per file, then cached. If you seeing it on 
> >> repeated runs in the same process, increase your realpath cache size 
> >> (yes, the default is way too small for any big app).
> > 
> > Another option may be to compute a hash of the file.  When you find
> > that file content has the same hash value as a known file you flag
> > them as "same file".  This could be faster (file contents are cached
> > in main memory because the OS already knows the files are the same,
> > and finding the "real" name of a file is a slow process).
> 
> When properly configured the realpath result should be cached as well
> though and we avoid calling a hash function on what could potentially be
> a lot of data.

The idea is to replace lstat system calls by hashing; in both cases
one would cache the result. Which is faster depends on the number
of pathname elements: system calls are relatively expensive, and
memory mapping could avoid the need for explicit file read() system
calls. If someone has the time then they can test if my idea is
totally bonkers (which it may well be).

Wietse

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Rasmus Lerdorf
On 6/23/10 6:56 AM, Wietse Venema wrote:
> Stas Malyshev:
>> Hi!
>>
>>> could anybody tell me why also for every single php file engine must lstat
>>> all path?
>>> Why php engine don't simply try to open directly the file?
>>
>> There are some places where PHP engine has to know "true" name of the 
>> file - i.e. filename that would be the same for each file regardless of 
>> how it is accessed - through relative path, symlinks, etc. Example can 
>> be {include|require}_once. For that, it needs to figure out the whole 
>> path. It is done only once per file, then cached. If you seeing it on 
>> repeated runs in the same process, increase your realpath cache size 
>> (yes, the default is way too small for any big app).
> 
> Another option may be to compute a hash of the file.  When you find
> that file content has the same hash value as a known file you flag
> them as "same file".  This could be faster (file contents are cached
> in main memory because the OS already knows the files are the same,
> and finding the "real" name of a file is a slow process).

When properly configured the realpath result should be cached as well
though and we avoid calling a hash function on what could potentially be
a lot of data.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Wietse Venema
Stas Malyshev:
> Hi!
> 
> > could anybody tell me why also for every single php file engine must lstat
> > all path?
> > Why php engine don't simply try to open directly the file?
> 
> There are some places where PHP engine has to know "true" name of the 
> file - i.e. filename that would be the same for each file regardless of 
> how it is accessed - through relative path, symlinks, etc. Example can 
> be {include|require}_once. For that, it needs to figure out the whole 
> path. It is done only once per file, then cached. If you seeing it on 
> repeated runs in the same process, increase your realpath cache size 
> (yes, the default is way too small for any big app).

Another option may be to compute a hash of the file.  When you find
that file content has the same hash value as a known file you flag
them as "same file".  This could be faster (file contents are cached
in main memory because the OS already knows the files are the same,
and finding the "real" name of a file is a slow process).

Wietse

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-23 Thread Vincenzo D'Amore
Many thanks to everybody helped me.
I will follow your suggestions and check it.

Best regards,
Vincenzo

On Mon, Jun 21, 2010 at 9:39 PM, Stas Malyshev wrote:

> Hi!
>
>
>  could anybody tell me why also for every single php file engine must lstat
>> all path?
>> Why php engine don't simply try to open directly the file?
>>
>
> There are some places where PHP engine has to know "true" name of the file
> - i.e. filename that would be the same for each file regardless of how it is
> accessed - through relative path, symlinks, etc. Example can be
> {include|require}_once. For that, it needs to figure out the whole path. It
> is done only once per file, then cached. If you seeing it on repeated runs
> in the same process, increase your realpath cache size (yes, the default is
> way too small for any big app).
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>



-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
msn: free...@hotmail.com
skype: free.dev
mobile: +39 349 8513251


Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Stas Malyshev

Hi!


could anybody tell me why also for every single php file engine must lstat
all path?
Why php engine don't simply try to open directly the file?


There are some places where PHP engine has to know "true" name of the 
file - i.e. filename that would be the same for each file regardless of 
how it is accessed - through relative path, symlinks, etc. Example can 
be {include|require}_once. For that, it needs to figure out the whole 
path. It is done only once per file, then cached. If you seeing it on 
repeated runs in the same process, increase your realpath cache size 
(yes, the default is way too small for any big app).

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Rasmus Lerdorf
On 6/21/10 9:35 AM, Vincenzo D'Amore wrote:
> Thanks Rasmus,
> 
> we are using wordpress. Looking at code:
> 
> find . -type f -exec grep realpath {} \;
> 
> I see a lot of:
> 
> if ( function_exists('realpath') )
> $path = realpath($path);
> if ( function_exists('realpath') )
> $path = realpath($path);
> if ( function_exists('realpath') )
> $path = realpath($path);
> if ( realpath($path) == $path )
> if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) )
> 
> What do you think if I disable such function? 

It is more likely a cache problem.  Fix your realpath_cache settings
like I suggested.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Pierre Joye
hi,

On Mon, Jun 21, 2010 at 7:23 PM, Vincenzo D'Amore  wrote:
> Hello All,
>
> could anybody tell me why also for every single php file engine must lstat
> all path?

It is done once per paths set and then cached.

> Why php engine don't simply try to open directly the file?

Many reasons, one of the parent paths may not be accessible, check
open base dir, etc. It can resolve links too while being at it.

cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Vincenzo D'Amore
Hello All,

could anybody tell me why also for every single php file engine must lstat
all path?
Why php engine don't simply try to open directly the file?

[pid 13792] lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) =
0
[pid 13792] lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
{st_mode=S_IFDIR|0755, st_size=13312, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792]
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792]
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
[pid 13792]
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792]
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
{st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
[pid 13792]
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-blog-header.php",
{st_mode=S_IFREG|0644, st_size=274, ...}) = 0



-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
msn: free...@hotmail.com
skype: free.dev
mobile: +39 349 8513251


Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Vincenzo D'Amore
Rasmus,

I have disabled realpath from php.ini,

disable_functions =
passthru,proc_close,proc_get_status,proc_nice,proc,exec,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source,set_time_limit,error_reporting,mail,fsockopen,ini_set,
*realpath*

And stop and start of apache httpd.
Again when I tried to strace the site I see same behavior:

[pid 13792] lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
{st_mode=S_IFDIR|0755, st_size=13312, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
{st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-blog-header.php",
{st_mode=S_IFREG|0644, st_size=274, ...}) = 0
[pid 13792] lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
{st_mode=S_IFDIR|0755, st_size=13312, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
{st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-blog-header.php",
{st_mode=S_IFREG|0644, st_size=274, ...}) = 0
[pid 13792] lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
{st_mode=S_IFDIR|0755, st_size=13312, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 13792] 
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
[pid 13792] 
getcwd("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs"...,
4096) = 87
[pid 13792] lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 13792] lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
[

Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Vincenzo D'Amore
Thanks Ferenc,

there is non Suhosin patch/extension installed.

On Mon, Jun 21, 2010 at 4:52 PM, Ferenc Kovacs  wrote:

> Check the output of phpinfo()
> should see
> "This server is protected with the Suhosin Patch"
> and/or
> "This server is protected with the Suhosin Extension"
>
> Tyrael
>
> On Mon, Jun 21, 2010 at 4:48 PM, Vincenzo D'Amore wrote:
>
>> Hello Oliver,
>>
>> looking at php.ini configuration I don't see any suhosin entry, so I think
>> no.
>> do you know if there is another way to understand if it is installed?
>>
>> On Sun, Jun 20, 2010 at 12:06 PM, Olivier B. 
>> wrote:
>>
>> > Hi,
>> >
>> > are you using the "suhosin" patch for PHP ? I can see the same lstat
>> > behaviour with my setups, because of suhosin.
>> > But for the 8 tentative of reading, are you sure php deliver only one
>> page
>> > here ?
>> >
>> > Olivier
>> >
>> > Le 20/06/2010 08:49, Vincenzo D'Amore a écrit :
>> >
>> >  Hello,
>> >>
>> >> to have a performance problem with apache/mod_php5 configuration under
>> >> heavy
>> >> load the website becomes too slow.
>> >> Using strace I found what appears to me a strange behavior
>> >> The strange behavior I want point out is related to a sequence of
>> >> tentative
>> >> httpd/mod_php5 does in order to read an php page.
>> >>
>> >> In this particular case apache httpd servers tries 8 times before reach
>> >> and
>> >> read the file (if you want I can send the complete strace output)
>> >> More strange all these tentative seems to be correctly completed
>> because
>> >> of
>> >> success (0) return code for each line.
>> >> Ffor every file should be served by apache httpd, apache httpd tries to
>> >> lstat all directory in path more times:
>> >>
>> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> >> ...})
>> >> = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08",
>> {st_mode=S_IFDIR|0777,
>> >> st_size=1024, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> >> {st_mode=S_IFDIR|0755,
>> >> st_size=13312, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
>> >> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
>> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
>> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
>> >> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>> >>
>> >> *FIRST TENTATIVE*
>> >>
>> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> >> ...})
>> >> = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08",
>> {st_mode=S_IFDIR|0777,
>> >> st_size=1024, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> >> {st_mode=S_IFDIR|0755,
>> >> st_size=13312, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>> >>
>> >>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0

Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Vincenzo D'Amore
Thanks Rasmus,

we are using wordpress. Looking at code:

find . -type f -exec grep realpath {} \;

I see a lot of:

if ( function_exists('realpath') )
 $path = realpath($path);
if ( function_exists('realpath') )
$path = realpath($path);
 if ( function_exists('realpath') )
$path = realpath($path);
if ( realpath($path) == $path )
 if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) )

What do you think if I disable such function?

Best regards,
Vincenzo

On Sun, Jun 20, 2010 at 3:37 PM, Rasmus Lerdorf  wrote:

> On 6/19/10 11:49 PM, Vincenzo D'Amore wrote:
> > Could anybody explain me why I have this behavior and if it is
> attributable
> > to a misconfiguration of php?
>
> This doesn't look like a PHP misconfiguration.  It looks more like an
> application-level issue.  Do a grep for "realpath" in your application
> code.  A single call to realpath() would cause that tree of stat calls
> you see.  Also, you might be overflowing your realpath cache.  PHP 5.2
> is not using the cache very efficiently.  This is fixed in 5.3.  But try
> increasing your cache ttl and the size as well.  eg.
>
> realpath_cache_size = 256k
> realpath_cache_ttl  = 7200
>
> -Rasmus
>



-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
msn: free...@hotmail.com
skype: free.dev
mobile: +39 349 8513251


Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Ferenc Kovacs
Check the output of phpinfo()
should see
"This server is protected with the Suhosin Patch"
and/or
"This server is protected with the Suhosin Extension"

Tyrael

On Mon, Jun 21, 2010 at 4:48 PM, Vincenzo D'Amore wrote:

> Hello Oliver,
>
> looking at php.ini configuration I don't see any suhosin entry, so I think
> no.
> do you know if there is another way to understand if it is installed?
>
> On Sun, Jun 20, 2010 at 12:06 PM, Olivier B. 
> wrote:
>
> > Hi,
> >
> > are you using the "suhosin" patch for PHP ? I can see the same lstat
> > behaviour with my setups, because of suhosin.
> > But for the 8 tentative of reading, are you sure php deliver only one
> page
> > here ?
> >
> > Olivier
> >
> > Le 20/06/2010 08:49, Vincenzo D'Amore a écrit :
> >
> >  Hello,
> >>
> >> to have a performance problem with apache/mod_php5 configuration under
> >> heavy
> >> load the website becomes too slow.
> >> Using strace I found what appears to me a strange behavior
> >> The strange behavior I want point out is related to a sequence of
> >> tentative
> >> httpd/mod_php5 does in order to read an php page.
> >>
> >> In this particular case apache httpd servers tries 8 times before reach
> >> and
> >> read the file (if you want I can send the complete strace output)
> >> More strange all these tentative seems to be correctly completed because
> >> of
> >> success (0) return code for each line.
> >> Ffor every file should be served by apache httpd, apache httpd tries to
> >> lstat all directory in path more times:
> >>
> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> >> ...})
> >> = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> >> st_size=1024, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> >> {st_mode=S_IFDIR|0755,
> >> st_size=13312, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> >> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
> >> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
> >>
> >> *FIRST TENTATIVE*
> >>
> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> >> ...})
> >> = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> >> st_size=1024, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> >> {st_mode=S_IFDIR|0755,
> >> st_size=13312, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> >> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/

Re: [PHP-DEV] Performance problem with php

2010-06-21 Thread Vincenzo D'Amore
Hello Oliver,

looking at php.ini configuration I don't see any suhosin entry, so I think
no.
do you know if there is another way to understand if it is installed?

On Sun, Jun 20, 2010 at 12:06 PM, Olivier B.  wrote:

> Hi,
>
> are you using the "suhosin" patch for PHP ? I can see the same lstat
> behaviour with my setups, because of suhosin.
> But for the 8 tentative of reading, are you sure php deliver only one page
> here ?
>
> Olivier
>
> Le 20/06/2010 08:49, Vincenzo D'Amore a écrit :
>
>  Hello,
>>
>> to have a performance problem with apache/mod_php5 configuration under
>> heavy
>> load the website becomes too slow.
>> Using strace I found what appears to me a strange behavior
>> The strange behavior I want point out is related to a sequence of
>> tentative
>> httpd/mod_php5 does in order to read an php page.
>>
>> In this particular case apache httpd servers tries 8 times before reach
>> and
>> read the file (if you want I can send the complete strace output)
>> More strange all these tentative seems to be correctly completed because
>> of
>> success (0) return code for each line.
>> Ffor every file should be served by apache httpd, apache httpd tries to
>> lstat all directory in path more times:
>>
>> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> ...})
>> = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
>> st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> {st_mode=S_IFDIR|0755,
>> st_size=13312, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
>> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
>> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>>
>> *FIRST TENTATIVE*
>>
>> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> ...})
>> = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
>> st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> {st_mode=S_IFDIR|0755,
>> st_size=13312, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
>> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
>> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>>
>> *SECOND*
>>
>>  lstat("/

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Michael Shadle
Is this only useful for 5.2.x and is it only for realpath() or is it for any 
sort of path lookup and caching? Like resolving include paths and such?


On Jun 20, 2010, at 6:37 AM, Rasmus Lerdorf  wrote:

> realpath_cache_size = 256k
> realpath_cache_ttl  = 7200

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Rasmus Lerdorf
On 6/19/10 11:49 PM, Vincenzo D'Amore wrote:
> Could anybody explain me why I have this behavior and if it is attributable
> to a misconfiguration of php?

This doesn't look like a PHP misconfiguration.  It looks more like an
application-level issue.  Do a grep for "realpath" in your application
code.  A single call to realpath() would cause that tree of stat calls
you see.  Also, you might be overflowing your realpath cache.  PHP 5.2
is not using the cache very efficiently.  This is fixed in 5.3.  But try
increasing your cache ttl and the size as well.  eg.

realpath_cache_size = 256k
realpath_cache_ttl  = 7200

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Olivier B.

Hi,

are you using the "suhosin" patch for PHP ? I can see the same lstat 
behaviour with my setups, because of suhosin.
But for the 8 tentative of reading, are you sure php deliver only one 
page here ?


Olivier

Le 20/06/2010 08:49, Vincenzo D'Amore a écrit :

Hello,

to have a performance problem with apache/mod_php5 configuration under heavy
load the website becomes too slow.
Using strace I found what appears to me a strange behavior
The strange behavior I want point out is related to a sequence of tentative
httpd/mod_php5 does in order to read an php page.

In this particular case apache httpd servers tries 8 times before reach and
read the file (if you want I can send the complete strace output)
More strange all these tentative seems to be correctly completed because of
success (0) return code for each line.
Ffor every file should be served by apache httpd, apache httpd tries to
lstat all directory in path more times:

lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP", {st_mode=S_IFDIR|0755,
st_size=13312, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
{st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
{st_mode=S_IFREG|0777, st_size=1312, ...}) = 0

*FIRST TENTATIVE*

lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP", {st_mode=S_IFDIR|0755,
st_size=13312, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
{st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
{st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
{st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
{st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
{st_mode=S_IFREG|0777, st_size=1312, ...}) = 0

*SECOND*

  lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
st_size=1024, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP", {st_mode=S_IFDIR|0755,
st_size=13312, ...}) = 0
lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
{st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
lstat("/usr/local

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Ferenc Kovacs
If you have more than once directory in your include path, then the engine
have to look up the given file in each of the given directories, which is in
the worst case scenario (the given file is in the directory which is in the
last in the include path) could mean N lookup, where N is the number of the
directories in the include path.

but as far as I can see in the trace, this isn't the case.

Tyrael

On Sun, Jun 20, 2010 at 11:44 AM, Vincenzo D'Amore wrote:

> Hi Dinh,
>
> sorry, I don't get why having a wrong include_path configuration inside WP
> should have a negative outcome like have 8 tentatives in order to read this
> file.
>
> Regards,
> Vincenzo
>
>
> On Sun, Jun 20, 2010 at 9:26 AM, Dinh  wrote:
>
> > Hi,
> >
> > Unfortunately, your web application abused include_path. You can change
> WP
> > source code to include PHP files using absolute path
> >
> > Regards,
> >
> > Dinh
> >
> > On Sun, Jun 20, 2010 at 1:49 PM, Vincenzo D'Amore  >wrote:
> >
> >> Hello,
> >>
> >> to have a performance problem with apache/mod_php5 configuration under
> >> heavy
> >> load the website becomes too slow.
> >> Using strace I found what appears to me a strange behavior
> >> The strange behavior I want point out is related to a sequence of
> >> tentative
> >> httpd/mod_php5 does in order to read an php page.
> >>
> >> In this particular case apache httpd servers tries 8 times before reach
> >> and
> >> read the file (if you want I can send the complete strace output)
> >> More strange all these tentative seems to be correctly completed because
> >> of
> >> success (0) return code for each line.
> >> Ffor every file should be served by apache httpd, apache httpd tries to
> >> lstat all directory in path more times:
> >>
> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> >> ...})
> >> = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> >> st_size=1024, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> >> {st_mode=S_IFDIR|0755,
> >> st_size=13312, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> >> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> >> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
> >> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
> >>
> >> *FIRST TENTATIVE*
> >>
> >> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> >> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> >> ...})
> >> = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> >> st_size=1024, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> >> {st_mode=S_IFDIR|0755,
> >> st_size=13312, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> >> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> >> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> >> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> >> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >>
> >>
> lstat("/usr/local/sitipersonali/s

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Vincenzo D'Amore
Hi Dinh,

sorry, I don't get why having a wrong include_path configuration inside WP
should have a negative outcome like have 8 tentatives in order to read this
file.

Regards,
Vincenzo


On Sun, Jun 20, 2010 at 9:26 AM, Dinh  wrote:

> Hi,
>
> Unfortunately, your web application abused include_path. You can change WP
> source code to include PHP files using absolute path
>
> Regards,
>
> Dinh
>
> On Sun, Jun 20, 2010 at 1:49 PM, Vincenzo D'Amore wrote:
>
>> Hello,
>>
>> to have a performance problem with apache/mod_php5 configuration under
>> heavy
>> load the website becomes too slow.
>> Using strace I found what appears to me a strange behavior
>> The strange behavior I want point out is related to a sequence of
>> tentative
>> httpd/mod_php5 does in order to read an php page.
>>
>> In this particular case apache httpd servers tries 8 times before reach
>> and
>> read the file (if you want I can send the complete strace output)
>> More strange all these tentative seems to be correctly completed because
>> of
>> success (0) return code for each line.
>> Ffor every file should be served by apache httpd, apache httpd tries to
>> lstat all directory in path more times:
>>
>> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> ...})
>> = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
>> st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> {st_mode=S_IFDIR|0755,
>> st_size=13312, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
>> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
>> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>>
>> *FIRST TENTATIVE*
>>
>> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
>> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
>> ...})
>> = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
>> st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
>> {st_mode=S_IFDIR|0755,
>> st_size=13312, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
>> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
>> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
>> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
>> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
>> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>>
>> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
>> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>>
>> *SECOND*
>>
>>  lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Vincenzo D'Amore
Yes, right.

# /usr/libexec/php5-cgi/bin/php -v
PHP 5.2.9 (cli) (built: Sep 14 2009 16:52:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.1.33, Copyright (c) 2002-2007, by ionCube
Ltd.

# httpd -V
Server version: Apache/2.2.11 (Unix)
Server built:   Jan  8 2009 09:27:22
Server's Module Magic Number: 20051115:21
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM: Prefork
  threaded: no
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

# cat /proc/version
Linux version 2.6.18-028stab062.3 (r...@rhel5-64-build) (gcc version 4.1.2
20070626 (Red Hat 4.1.2-14)) #1 SMP Thu Mar 26 14:46:38 MSK 2009

On Sun, Jun 20, 2010 at 9:11 AM, Alexey Zakhlestin wrote:

>
> On 20.06.2010, at 10:49, Vincenzo D'Amore wrote:
>
> > Hello,
> >
> > to have a performance problem with apache/mod_php5 configuration under
> heavy
> > load the website becomes too slow.
> > Using strace I found what appears to me a strange behavior
> > The strange behavior I want point out is related to a sequence of
> tentative
> > httpd/mod_php5 does in order to read an php page.
>
> let's start with the basics.
>
> what version of php is this?
> what version of apache (and which mpm) is this?
> what OS is this?
>
> --
> Alexey Zakhlestin
> http://www.milkfarmsoft.com/
>
>
>
>
>


-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
msn: free...@hotmail.com
skype: free.dev
mobile: +39 349 8513251


Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Ferenc Kovacs
Hi.

Shouldn't we seeing failed lstats if the include_path would be the problem?
And I thought that the php engine itself tries to cache the fileinfo, to
minimize the lstat calls ( see
http://hu.php.net/manual/en/function.clearstatcache.php )
So I think that we shouldn't see this much duplicate lstat calls.

Tyrael

On Sun, Jun 20, 2010 at 9:26 AM, Dinh  wrote:

> Hi,
>
> Unfortunately, your web application abused include_path. You can change WP
> source code to include PHP files using absolute path
>
> Regards,
>
> Dinh
>
> On Sun, Jun 20, 2010 at 1:49 PM, Vincenzo D'Amore  >wrote:
>
> > Hello,
> >
> > to have a performance problem with apache/mod_php5 configuration under
> > heavy
> > load the website becomes too slow.
> > Using strace I found what appears to me a strange behavior
> > The strange behavior I want point out is related to a sequence of
> tentative
> > httpd/mod_php5 does in order to read an php page.
> >
> > In this particular case apache httpd servers tries 8 times before reach
> and
> > read the file (if you want I can send the complete strace output)
> > More strange all these tentative seems to be correctly completed because
> of
> > success (0) return code for each line.
> > Ffor every file should be served by apache httpd, apache httpd tries to
> > lstat all directory in path more times:
> >
> > lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> > lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> > lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> > ...})
> > = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> > st_size=1024, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> > {st_mode=S_IFDIR|0755,
> > st_size=13312, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> > {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> > {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> > {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> > {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> > {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> > {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
> > {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
> >
> > *FIRST TENTATIVE*
> >
> > lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> > lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> > lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> > ...})
> > = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> > st_size=1024, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> > {st_mode=S_IFDIR|0755,
> > st_size=13312, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> > {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> > {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> > lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> > {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> > {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> > {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> > {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >
> >
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> > {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
> >
> >
> ls

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Dinh
Hi,

Unfortunately, your web application abused include_path. You can change WP
source code to include PHP files using absolute path

Regards,

Dinh

On Sun, Jun 20, 2010 at 1:49 PM, Vincenzo D'Amore wrote:

> Hello,
>
> to have a performance problem with apache/mod_php5 configuration under
> heavy
> load the website becomes too slow.
> Using strace I found what appears to me a strange behavior
> The strange behavior I want point out is related to a sequence of tentative
> httpd/mod_php5 does in order to read an php page.
>
> In this particular case apache httpd servers tries 8 times before reach and
> read the file (if you want I can send the complete strace output)
> More strange all these tentative seems to be correctly completed because of
> success (0) return code for each line.
> Ffor every file should be served by apache httpd, apache httpd tries to
> lstat all directory in path more times:
>
> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> ...})
> = 0
> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> st_size=1024, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> {st_mode=S_IFDIR|0755,
> st_size=13312, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>
> *FIRST TENTATIVE*
>
> lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> ...})
> = 0
> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> st_size=1024, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> {st_mode=S_IFDIR|0755,
> st_size=13312, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa",
> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al",
> {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps",
> {st_mode=S_IFDIR|0750, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451",
> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs",
> {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content",
> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages",
> {st_mode=S_IFDIR|0777, st_size=1024, ...}) = 0
>
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-content/languages/zh_CN.php",
> {st_mode=S_IFREG|0777, st_size=1312, ...}) = 0
>
> *SECOND*
>
>  lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat("/usr/local/sitipersonali", {st_mode=S_IFDIR|0755, st_size=4096,
> ...})
> = 0
> lstat("/usr/local/sitipersonali/sitipersonali08", {st_mode=S_IFDIR|0777,
> st_size=1024, ...}) = 0
> lstat("/usr/local/sitipersonali/sitipersonali08/NSP",
> {st_mode=S_IFDIR|0755,
> s

Re: [PHP-DEV] Performance problem with php

2010-06-20 Thread Alexey Zakhlestin

On 20.06.2010, at 10:49, Vincenzo D'Amore wrote:

> Hello,
> 
> to have a performance problem with apache/mod_php5 configuration under heavy
> load the website becomes too slow.
> Using strace I found what appears to me a strange behavior
> The strange behavior I want point out is related to a sequence of tentative
> httpd/mod_php5 does in order to read an php page.

let's start with the basics.

what version of php is this?
what version of apache (and which mpm) is this?
what OS is this?

-- 
Alexey Zakhlestin
http://www.milkfarmsoft.com/






smime.p7s
Description: S/MIME cryptographic signature