ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-spanish
php-spanish
[PHP-ES] Demasiada memoria ram
by Manolet Gmail other posts by this author
Oct 5 2009 4:23AM messages near this date
[PHP-ES] Incluir aplicaciones que tengo en otro dominio | Re: [PHP-ES] Demasiada memoria ram
Hola, tengo un script en php para descargar archivos (todos son de 3MB), el
problema esta en que tengo cerca de 200.000 descargas al d�a y en algunas
horas pico el server se bloquea y se cae mysql. Estoy usando la funcion
readfile y tengo la impresi�n de que el problema esta porque se guarda todo
el archivo en memoria, y si hay varias descargas simultaneas (las
suficientes) mi server truena.
header('Content-type: application/octet-stream');
    header("Content-Disposition: attachment; filename=$softwarename;");
 header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".filesize($cache));
    // @todo cambiar readfile por una redireccion a la url del archivo o una
funcion para leer de byte en byte o otra solucion para no usar tanta memoria
    readfile($cache);

Que soluci�n le puedo dar a este problema?
Thread:
Manolet Gmail
Gerardo Benitez
Isart Montane

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved