Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48925 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61872 invoked from network); 21 Jun 2010 16:59:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2010 16:59:06 -0000 Authentication-Results: pb1.pair.com header.from=v.damore@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=v.damore@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.153 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: v.damore@gmail.com X-Host-Fingerprint: 72.14.220.153 fg-out-1718.google.com Received: from [72.14.220.153] ([72.14.220.153:1444] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/BA-04556-95A9F1C4 for ; Mon, 21 Jun 2010 12:59:06 -0400 Received: by fg-out-1718.google.com with SMTP id l26so944826fgb.11 for ; Mon, 21 Jun 2010 09:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=KEv/ER80MMME5j/InYEdVpiNSfArYa3o45RyCXD8b9Y=; b=SvWSzMiH6AoLouKs3kw0aWcsR2IX37vF9CCyMtOSAHrZbfIMCnibIkrp+ZdJGs2M+F ul2JTGfY5zts/rDHC0nIZyknbCBgaS92rREEDIzApcn12w3oqCEXIVVg7Bwuj81S6TOw /MM+oFNjtgL51DztmvbryqYjMiWgPNWsZLvXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=iVWxXjUiGvrGdEa+PCHtZrWEnmpRe2EzxC56fHgzWN2EIGGqTyFp7iKgbIP0JSqXbk ZcyGQnZDdZtMLu703/aKFMh98ZbWzYQEPYJqojRfmuXgV0PaliUFdkocZ/bH8Xgl0nOv nuoLgNJNU3wZ3z2nIA00oVy2qWxY5PxWcD0TY= Received: by 10.239.174.15 with SMTP id h15mr354736hbf.105.1277139541226; Mon, 21 Jun 2010 09:59:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.189.6 with HTTP; Mon, 21 Jun 2010 09:58:41 -0700 (PDT) In-Reply-To: References: <4C1E1986.7030802@lerdorf.com> Date: Mon, 21 Jun 2010 18:58:41 +0200 Message-ID: To: Rasmus Lerdorf Cc: Internals Content-Type: multipart/alternative; boundary=001485f03c8aaef4d204898d3832 Subject: Re: [PHP-DEV] Performance problem with php From: v.damore@gmail.com ("Vincenzo D'Amore") --001485f03c8aaef4d204898d3832 Content-Type: text/plain; charset=UTF-8 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 [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] open("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-blog-header.php", O_RDONLY) = 415 [pid 13792] fstat(415, {st_mode=S_IFREG|0644, st_size=274, ...}) = 0 [pid 13792] lseek(415, 0, SEEK_SET) = 0 [pid 13792] fcntl(415, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE) [pid 13792] fstat(415, {st_mode=S_IFREG|0644, st_size=274, ...}) = 0 [pid 13792] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b56766f1000 [pid 13792] lseek(415, 0, SEEK_CUR) = 0 [pid 13792] open("/usr/local/sitipersonali/sitipersonali08/NSP/wa/al/wall/webspace/siteapps/21451/htdocs/wp-blog-header.php", O_RDONLY) = 416 [pid 13792] fstat(416, {st_mode=S_IFREG|0644, st_size=274, ...}) = 0 [pid 13792] mmap(NULL, 274, PROT_READ, MAP_SHARED, 416, 0) = 0x2b56766f2000 [pid 13792] munmap(0x2b56766f2000, 274) = 0 [pid 13792] close(416) = 0 [pid 13792] ioctl(415, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff344173a0) = -1 ENOTTY (Inappropriate ioctl for device) [pid 13792] read(415, "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? > > 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.damore@gmail.com > msn: freedev@hotmail.com > skype: free.dev > mobile: +39 349 8513251 > -- Vincenzo D'Amore email: v.damore@gmail.com msn: freedev@hotmail.com skype: free.dev mobile: +39 349 8513251 --001485f03c8aaef4d204898d3832--