Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56893 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44243 invoked from network); 12 Dec 2011 17:47:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2011 17:47:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.161.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:47287] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/99-17834-52E36EE4 for ; Mon, 12 Dec 2011 12:47:18 -0500 Received: by ggnv1 with SMTP id v1so6267048ggn.29 for ; Mon, 12 Dec 2011 09:47:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.41.69 with SMTP id d5mr3154541obl.47.1323712034330; Mon, 12 Dec 2011 09:47:14 -0800 (PST) Received: by 10.182.144.3 with HTTP; Mon, 12 Dec 2011 09:47:14 -0800 (PST) Date: Mon, 12 Dec 2011 12:47:14 -0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d0444e96b97584304b3e8b937 Subject: APC caching identical files multiple times From: rasmus@mindplay.dk (Rasmus Schultz) --f46d0444e96b97584304b3e8b937 Content-Type: text/plain; charset=ISO-8859-1 Hello Folks, We're hosting an increasing number of Drupal (ick) sites on our servers, and while going over the diagnostic screen for APC, we noticed that identical files are being cached multiple times. For example, "user.module" is cached 3 times for 3 sites. I've seen other people asking this question around forums and on SO, but no clear answer. According to the change-log, release 3.1.1 includes a "file_md5" option, which seems to be a dud - or maybe this was intended to be implemented at some point, but currently does nothing? The documentation isn't clear on what this option is for. It seems like it should not be too difficult to use an md5 (or other hash) of the file contents plus filename (sans path) and use that as the cache key? In shared hosting environments, this could reduce in-memory duplication quite a lot, or not? I think it's common to host multiple Drupal, Joomla or WordPress sites - all of which could share a common codebase, but personally I don't want them to, since this creates problems with deployment and maintenance/upgrades, and it seems like this would be a work-around more than a solution. Most sites use a framework these days, and most companies have one or two frameworks they prefer, so this feature would make a lot of sense. Is there some reason this is not as easy to implement as it might seem? (and just occurred to me, is this the correct list for this post? my apologies if it's not. looks like a lot of the contributors are on this list...) --f46d0444e96b97584304b3e8b937--