Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86810 invoked from network); 21 Feb 2013 23:15:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2013 23:15:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=brendon@newgrounds.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=brendon@newgrounds.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain newgrounds.com designates 209.85.214.49 as permitted sender) X-PHP-List-Original-Sender: brendon@newgrounds.com X-Host-Fingerprint: 209.85.214.49 mail-bk0-f49.google.com Received: from [209.85.214.49] ([209.85.214.49:55021] helo=mail-bk0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/C4-58335-3AAA6215 for ; Thu, 21 Feb 2013 18:15:48 -0500 Received: by mail-bk0-f49.google.com with SMTP id w11so31112bku.22 for ; Thu, 21 Feb 2013 15:15:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=CksWTR1J5+FXq0e7c0wwtMEsBq8vG87rzH1bWd11NEw=; b=X4mp1rKAiO7mpMk+QI1vlVN4CYw52TTLi54lV6jFE/FoXU3ZB+ED1ZdIJJWDSzZMu1 6N2S0poARn4gMjf8k5iI/v7fZyfrSGAefcuKYI+jBH0deudpnVp+JDs6d9iLBdIDZbhE uhPmLsrLfq3/0sZf2jQQiYJ2frJiHj+HDfe+66XvbNlM2it6p79mvvp2w/b7zO5+vjJb ugB8dnQKtxjZArBK6ELoRwmpR/3+21KFRbZPI5fiNIDGLtEMlBrBU1KwWbuviuj3Pg88 vszpBpF9r90AQjc+YoHPdG1+4jVivLxNZ8PTg1zsm4XxedLFcHJ+gVQLuWGnD1rtopkA 0JKQ== MIME-Version: 1.0 X-Received: by 10.204.153.203 with SMTP id l11mr10924446bkw.119.1361488545185; Thu, 21 Feb 2013 15:15:45 -0800 (PST) Received: by 10.204.27.19 with HTTP; Thu, 21 Feb 2013 15:15:44 -0800 (PST) In-Reply-To: <5122E451.1040308@lerdorf.com> References: <51229088.90306@lerdorf.com> <5122DA51.6090606@sugarcrm.com> <5122DBA9.2010004@lerdorf.com> <5122E00F.80409@sugarcrm.com> <5122E451.1040308@lerdorf.com> Date: Thu, 21 Feb 2013 18:15:44 -0500 Message-ID: To: Rasmus Lerdorf Cc: "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlQsEPSQlfG2rRxQJGEOADFHYO9IeSNqV0BAXi74x0rzcnv3jxMkqbA+PRaiR8489Gf7W/Q Subject: Re: [PHP-DEV] PHP causing high number of NFS getattr operations? From: brendon@newgrounds.com (Brendon Colby) On Mon, Feb 18, 2013 at 3:35 PM, Rasmus Lerdorf wrote: > Wow, people are still serving web files over NFS? Sounds painful. On Mon, Feb 18, 2013 at 9:32 PM, Rasmus Lerdorf wrote: > So they are serving up all their PHP over NFS for some reason. I've been thinking about this and wanted to make a few final points. I think this is potentially a pretty major issue and not something to be dismissed. We've invested a great deal of money in a high performance shared storage system, so of course we want to use this system for absolutely everything we can within reason, including sharing 1500+ PHP files to our many web servers. I don't think most systems administrators would find this unreasonable. Why would we want to split our architecture up so just our PHP files are being synced from local disk and everything else is shared via NFS? Doing this seems far more unreasonable to me and just doesn't make any sense. NFS is so common for sharing files that saying "Wow, people are still serving web files over NFS?" is like saying "Wow, people are still using the ls command to list directory contents on Linux?" I think NFS is still very widely used, even for sharing web files. This being said, you stated in bug #59372 that "PHP by default does open+fstat for performance reasons" and while doing an open+fstat might result in better performance on local file systems, doing so is not optimal when using NFS. NFS "close-to-open cache consistency" is designed such that opening a file stored on an NFS server causes an automatic getattr or access request. This could also be true for other shared file systems as others have mentioned. All of these open+fstats are definitely causing a measurable impact to our systems. Right now, for example, 50% of the 6-8K+ ops/s being processed by our filer are getattr operations, and a majority of these getattr calls are coming from our Apache/PHP servers. Doing open+fstat bypasses the NFS attribute cache similar to disabling it altogether, where a simple stat would likely utilize the attribute cache. Disabling the attribute cache is generally not recommended due to the performance impact this has on the filer (and the application). I don't think the appropriate answer is "don't use NFS" because this is ridiculous as a long term solution (NFS is common, and people are going to use it or something similar). I think the appropriate answer is to update PHP to use stat vs. open+fstat or doing something similar that would be optimized for both local AND shared file systems (I would be writing a patch instead of this email if I could). Until then, I think it's important that people know that PHP is NOT optimized for use with NFS (and possilby other shared file systems) even when using an opcode cache like APC. I think this is a very important piece of information that people need to know. Up until this week, I wouldn't have thought twice about sharing PHP files over NFS, and I've been a Unix admin for over twelve years (only new to this environment). Brendon