does file download using PHP, causes server/CPU overload? [duplicate]

On one of my site, I have a large-file download method using:

site.com/downloader.php?file=MyLargeFile.mp3

then PHP file executes readfile to start file downloading.

Typically, not to go in details of load-balancing, I just wanted to know how PHP engine works - does such approach in PHP (throwing files usingreadfile, file_get_contents or etc...) take more CPU/Overload, compared to downloading with direct links, like site.com/MyLargeFile.mp3? Or PHP engine does same using those commands?


There's no way to know for sure without more information. You need to check and see what's causing the high CPU usage, not ask. The top command will probably be a good start. We need you to gather some info and show us your script too possibly if you need help with it.

Otherwise it's just a guess and my guess is: yes direct file access is less likely to impact server performance. But your script and web config could be fine. There's no way to know. The problem could be something completely different.