views:

80

answers:

1

I am having massive performance problems on a site running two versions of the same CMS using PHP sessions. A page will take 5-6 seconds to load on one computer, and 300ms on the other.

I'm fairly sure the problem is located in session handling. I am already using different session_name()s and cookie paths for the different CMSs, to no avail.

In the user contributed notes to session_start(), I came across this entry from 2003:

Just for info, session_start() blocks if another PHP using the same session is still running in background. It seems it's waiting the other PHP to finish... and sometimes it can be a problem. Create 2 different sessions by setting 2 different names : session_name() solve the problem.

I have the feeling this has to do with my problem, however I can't find any further information on this and exactly in the way it's written, I can't imagine it's true.

Does somebody know what the author meant, and shed some additional light on this?

Edit: The problem is solved. It was actually a network misconfiguration at the client's that was very hard to detect and for some reason affected the site in question more than others. Accepting the answer that is there to mark the issue as solved. Thanks for everyone's time.

+4  A: 

You should meassure your sites performance with Xdebug or similar, to verify that the slowdown is indeed in session handling.

troelskn
Yes and it sounds doubtful that the slowdown is because of session handling. There are ways to speed up session handling, for instance by using memcached as a session handler, but as I say, I doubt that the sessions are slowing it down.
arnorhs
You were right. See the edit above. Cheers!
Pekka