It really seems like something is locking that session file, and it's as
if the lock is done for the full 30 seconds rather than simply locking
for as long as is needed.
I simplified my iframe script as much as I could...
<?php
session_save_path('../session_data');
session_name("S");
session_start();
elapsedTime(); //this is a little custom function that echoes out the
time the script has been running.
session_write_close();
exit;
?>
In the context of this application, it needs the custom session name and
session path, but those are next on my list of things to tinker with.
I'm certain this is a session issue of one kind or another - by
debugging I found the script will wait at the session_start command
until the 30 seconds is up. I'm just unsure why it would wait 30 seconds
when the previous request called session_write_close() in under 1 second.
It's worth noting at this point that this is PHP4.4 with register
globals on (you can spare the lecture, this wasn't my doing).
Any further ideas appreciated.
Harvey.
On 6/04/2011 3:58 p.m., Harvey Kane wrote:
Hi Tim,
Yes, that could absolutely be the problem. The site does use sessions,
and the behaviour is not unlike the example URL you have provided.
What I don't get is why it takes 30 seconds. I'm not seeing any
long-running PHP code, so the 30 seconds has to be coming from the
max_execution_time.
If request 1 is finished and done in 1 second, why does request 2 take
30 seconds? (and request 3 a further 30 seconds after that)
Thanks for the info, I'll continue looking into it.
Harvey.
On 6/04/2011 3:47 p.m., Tim Oliver wrote:
On Wed, Apr 6, 2011 at 3:37 PM, Harvey Kane<[email protected]>
wrote:
Do they use sessions? If you're using the default file-based session
handler, PHP will flock() the session file when you start the session,
and release it when the script ends or you call session_write_close.
This means that if you have a bunch of frames using the same session
file, they'll load sequentially rather than simultaneously. This
produces really weird behaviour sometimes if you have long-running
scripts.
Here's an example: http://dev.xi.co.nz/frame.php
--
Harvey Kane
Phone:
- Auckland: +64 9 950 4133
- Wanaka: +64 3 746 8133
- Mobile: +64 21 811 951
Email: [email protected]
If you need to contact me urgently, please read my email policy
www.ragepank.com/email/
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]