Search code examples
phpapache2ubuntu-8.10

Does apache / php blocks a single file to be processed from the same client concurrently?


I have everything setup and running with KalturaCE & Drupak and the server (Ubuntu 8.02+Apache2+PHP5+MySql) is working fine. The issue here I am having is unclassified.

When I play two videos together from my site, the second video which I played later doesn't start until the first completes its buffering. I did some HTTP watch and came to know that, both of the entries request the file with the URL as follows,

/kalturace/p/1/sp/100/flvclipper/entry_id/xxxxxx/flavor/1/version/100000

so the first video which I played receives a 302 redirect response to the URL as follows,

/kalturace/p/1/sp/100/flvclipper/entry_id/xxxxxxx/flavor/1/version/100000/a.flv?novar=0

and starts buffering and playing. While the second video which I started later just wait for a response till the first video end its buffering and then the second video receives its 302 redirect and start buffering

My question is, why can't both videos buffer concurrently? and Obviously this is what I require.

Your help is highly anticipated and much welcome.


Solution

  • PHP file-based sessions will lock the session file while a request is active. If you intend to use parallel requests like this, you'll have to make sure each script closes the session as soon as possible (ie: after writing out any changes) with session_write_close() to keep the lock time to a minimum.