php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30589 Unable to have concurrent execution of same page
Submitted: 2004-10-27 22:49 UTC Modified: 2004-10-29 21:40 UTC
From: brian dot foddy at nwa dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.0.2 OS: Solaris 2.8
Private report: No CVE-ID: None
 [2004-10-27 22:49 UTC] brian dot foddy at nwa dot com
Description:
------------
Frankly I can't believe this is a bug, but I can't
find any config to change this behavior...

Using 5.0.2 on Solaris 2.8 and Apache 1.3.22,
we are unable to have concurrent execuation of
the same script at the same time.  Any attempt
to run the script below from 2 browsers,
the first one will start normally, displaying
"starting", then during the sleep, try a second
request and it will not begin any execution
until the first request completes, then it begins
its normal execution.

If this script is duplicated to a different 
file name,
ie:  concurrent1.php and concurrent2.php, then
both can execute at the same time as you would expect.

This server was upgraded from version 4.3x some
months back and I'm sure it didn't have this 
behavior.  In general our server is a low-volume
intranet server so this problems only shows up
on rare occasions when a specific web app is 
needed.

Apache config:
MinSpareServers 2
MaxSpareServers  12
StartServers 8
MaxClients 20

The web server is not reaching these limits for 
my tests.

Reproduce code:
---------------
<?php 
print ("starting");
flush ();
touch ("foo.dat");

sleep (60);
?>
Done.



Execute from 2 browsers at the same time.

Expected result:
----------------
Both browsers should show "starting" then
wait the 60 seconds.

Actual result:
--------------
The first request starts normally, the second
page waits for the first to complete before the
second begins.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-27 23:33 UTC] derick@php.net
You're probably using session_auto_start or something. Run session_write_close() as first statement to close the session, this will allow your script to run concurrently.
 [2004-10-27 23:57 UTC] brian dot foddy at nwa dot com
Thanks for the quick reply, but

I modified the sample script to
<?php 
session_write_close();
print ("starting1");
flush ();
touch ("foo.dat");
sleep (60);
?>
Done.

but it has no effect.  
The flush call is only for demonstration/debug, my actual
script where I noticed the problem doesn't have this call.
The
contents of php.ini Session section are (comments removed),
pretty standard I believe:
[Session]
session.save_handler      = files
session.save_path         = /tmp
session.use_cookies       = 1
session.name              = PHPSESSID
session.auto_start        = 0
session.cookie_lifetime   = 0                                    
session.cookie_domain     =         session.serialize_handler = php     
session.gc_probability    = 1                                    
session.gc_maxlifetime    = 1440
session.referer_check     =                                      
session.entropy_length    = 0 
session.entropy_file      =   
;  session.entropy_length    = 16
;  session.entropy_file      = /dev/urandom
session.cache_limiter     = nocache                                     
session.use_trans_sid     = 1 
url_rewriter.tags         =
"a=href,area=href,frame=src,input=src,form=fakeentry"
 [2004-10-29 21:40 UTC] brian dot foddy at nwa dot com
There is something more at work here, and
current evidense points away from php5.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC