Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60391 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76969 invoked from network); 1 May 2012 14:10:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2012 14:10:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.53 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.53 mail-qa0-f53.google.com Received: from [209.85.216.53] ([209.85.216.53:50275] helo=mail-qa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/E5-38165-CBEEF9F4 for ; Tue, 01 May 2012 10:10:04 -0400 Received: by qadz32 with SMTP id z32so439847qad.12 for ; Tue, 01 May 2012 07:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3g9X9Z25SA80U/fA7VB3GzgC0EtPXMjnVzkcHe0ssr8=; b=NVQ3To55vYAMWJhqXt+A4Iy8fZJ10nFaJ2y2tHldd+VHMt3S88qzd6eHkSKz8giaTo 5+1fwLdcrFJpc1BIjnmWPMJetNyPzf29d2It7YFpnRcAxM5Sx1PGgrCYk7iAesCMtHJs mCB82O4Wa7tFq5DqWmF3BoHjIxkRj8RbBZyF/QqRjowlvklbJeBa/awJq86OTpCTBCYU 4CwVwARH4zbAYyQgJBhDX4YlLVTT1sSt9jJ/O53l33aNKZYuPynsaDhAZTAlJPERomuG /v5KNqkbq+zpqlxcoIkWXsXQNCAAjwoNqLqgl/4OgtGOYKjq79VBVNMCbCM0hi3QYaXG Opfg== MIME-Version: 1.0 Received: by 10.224.196.9 with SMTP id ee9mr6274480qab.22.1335881401777; Tue, 01 May 2012 07:10:01 -0700 (PDT) Received: by 10.229.251.203 with HTTP; Tue, 1 May 2012 07:10:01 -0700 (PDT) In-Reply-To: References: <4F9E2173.50005@garfieldtech.com> <000e01cd269a$06f15230$14d3f690$@php.net> <002701cd26b5$1cd0bb70$56723250$@thetaphi.de> <4F9EC8B4.3040600@garfieldtech.com> <4F9F4208.7020106@garfieldtech.com> Date: Tue, 1 May 2012 10:10:01 -0400 Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net, Paul Reinheimer , Larry Garfield Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] readfile() memory usage From: ircmaxell@gmail.com (Anthony Ferrara) I know it doesn't really fit this problem in general, but I figured I would point it out. Lighttpd introduced a brilliant concept by letting the server serve that file directly. Basically, instead of using readfile, you would just send a header: X-SendFile: $filename... It's available for Apache (as a module: http://www.jasny.net/articles/how-i-php-x-sendfile/) and NginX as well. The benefit is that the file never needs to be moved around in memory, it can be directly mapped to the network card by the OS. Just pointing it out (although it doesn't directly apply to the memory usage, it solves the problem differently, and better)... Anthony On Tue, May 1, 2012 at 9:55 AM, Gustavo Lopes wrot= e: > On Tue, 01 May 2012 15:39:56 +0200, Paul Reinheimer > wrote: > >>> Fascinating. =A0I even verified the md5sum of the file I got on the oth= er >>> end just to be sure. =A0I'll hold off on the blog post then. :-) =A0I l= ook >>> forward to your test setup. >> >> >> The server in question is still on PHP 5.2.13 >> >> [...] >> >> >> I'll try something newer, but I wanted to prove myself not crazy and >> do it on the server in question first. >> > > Unfortunately, you've ignored Uwe's e-mail... The problem is not the PHP > version; the problem is that you're buffering unlimited amounts of data. > Check your configuration and make sure ob_get_level() returns 0. > > -- > Gustavo Lopes > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >