Re: [PHP] Slow file download

2008-12-02 Thread ceo
If the files are LARGE, file_get_contents is a Bad Idea (tm). You're trying to suck the whole thing into RAM, which it can't, which swaps and thrashes the bleep out of your RAM/swap space... Use fopen and an fread loop instead, and you'll probably see much better performance. Also, cons

Re: [PHP] Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 12:14 -0800, Brian Dunning wrote: > I'm open to something like that - we're in the middle of the holiday > crunch and can't afford any downtime, so a significant change is out > of the question. This is part of much larger and more involved > scripting, so it would need

Re: [PHP] Slow file download

2008-12-02 Thread Brian Dunning
I'm open to something like that - we're in the middle of the holiday crunch and can't afford any downtime, so a significant change is out of the question. This is part of much larger and more involved scripting, so it would need to be a plug-n-play replacement and also be able to return inf

Re: [PHP] Slow file download

2008-12-02 Thread Ashley Sheridan
On Tue, 2008-12-02 at 11:55 -0800, Brian Dunning wrote: > I'm using a PHP cron job to constantly download files from a remote > server. Client and server both have abundant unused bandwidth, and the > sysads have already eliminated switches, interface cards, etc. as the > source of the slowdo