Jump to content

Is Apache limiting php to one process at a time?


captbaritone

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.