note 52988 deleted from function.session-start by peehaa

From: Date: Fri, 09 Dec 2016 21:58:56 +0000
Subject: note 52988 deleted from function.session-start by peehaa
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-208309@lists.php.net to get a copy of this message
Note Submitter: corey at eyewantmedia dot com ---- Here is a crazy feature -- you get one concurrent database connection per session, transparent to the programmer! I am running php 5.0.4 on iis 6 (yeah, I know...). I noticed under stress testing that database connections were my bottleneck. I spent like 5 hours turning this on, that off, etc because I could not get php to create more than one database connection at a time, regardless of how many requests it was servicing. I tried running php as fastcgi, cgi, and isapi module. I tried using mysql and mysqli extensions. Same thing every time. Then I happened to turn off auto-start sessions and commented out my session_start() calls, and all of the sudden I get multiple connections like I expected! Don't let this happen to you -- don't freak out! Apparently something somewhere tries to make sure your visitors don't get more than their share of your resources, so they get one db connection per session. I can't say it is what I would like to happen, but now that I know, it doesn't bother me much :) Hope this saves someone some time and headache!

« previous php.notes (#208309) next »