captbaritone Posted August 20, 2008 Share Posted August 20, 2008 I have a web application which transcodes audio. It uses popen to decode from one format and then re-encode into .mp3 on the fly. Example: // Download "song.flac" as an mp3 file: $h = popen("flac --decode --stdout \"song.flac\" | lame - -", "r"); while (!feof($h)) { $buffer = fread($h, 8192); echo $buffer; } As you can imagine, this is fairly CPU intensive. This is not a huge problem, because the site is essentially for personal use. However, I am running into one problem: While I am downloading one of these transcoded audio files, php will not process another page. Apache will serve me other, non php, files, but if I try to load a php page, the browser just sits there until the transcoded file is done, and then recieves the php page almost immediately. Is Apache limiting php to one process at a time? How can I fix this? -Captbaritone Link to comment https://forums.phpfreaks.com/topic/120502-is-apache-limiting-php-to-one-process-at-a-time/ Share on other sites More sharing options...
JonnoTheDev Posted August 20, 2008 Share Posted August 20, 2008 Whilst running this use the 'top' command on your server to check the CPU usage. If it is maxed then the server is struggling to do anything else. You may need to increase the memory allowance. Link to comment https://forums.phpfreaks.com/topic/120502-is-apache-limiting-php-to-one-process-at-a-time/#findComment-621028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.