Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.