[pmwiki-users] Help! Performance problem after server move
jo at durchholz.org
Tue Apr 4 16:19:33 CDT 2006
Patrick R. Michaud schrieb:
> I'm fairly
> convinced it's not directly PmWiki's fault, because it happens very
> inconsistently. For more details -- see my message at
Now that "happens very inconsistently" triggered something in my mind.
I know of one thing that happens at random intervals in PHP: session GC.
With the standard settings, it is run with a 1% probability - very
difficult to reproduce any problems with that.
My hypothesis is that PHP places all the session files in one directory
(usually between 670 and 720 on my system, which isn't too heavily
loaded). Now when GC runs, it has to stat all the files and delete those
that are too old - if the file system is slow with large directories,
this can indeed take a noticeable amount of time.
To test, one can switch off session GC and see whether the erratic
behavior vanishes. Expect PHP to slowly degrade, as the number of
session files will increase, and the file system will take longer and
longer to find and open a file.
(This test is probably best set up on an idle spare server, and hammered
away with new sessions. E.g. set up a client to request pages via wget
in a tight loop, and monitor session file count on the server and wget
latencies on the client.)
If that's indeed the cause, the best way to get rid of the problem would
be to use a SQL-based session manager. (Or to switch to reiserfs, which
is - among other things - a database engine for file names.)
More information about the pmwiki-users