I am using 2 php libraries to serve files- unzip, and dUnzip2
zip zip.lib
http://www.zend.com/codex.php?id=470&single=1
They work fine on files under 10MB , but with files over 10MB, I have to set the mem limit to 256. With files over 25MB, I set it to 512. It seems kind of high… Is it?
I’m on a dedicated server- 4 CPU’s and 16GB RAM – but we also have a lot of traffic and downloading, so I’m kind of wondering here.
Perhaps you’re using php to load the whole files into memory before serving them to the user? I’ve used a function found at http://www.php.net/manual/en/function.readfile.php (comments section) that serves the file in parts, keeping memory low. Copying from that post (because my version is changed):