[UPHPU] stuffing the session bird
Ray Hunter
bigdog at venticon.com
Sun Mar 6 21:19:09 MST 2005
On Sat, 2005-03-05 at 13:44 -0700, David Smith wrote:
> It depends on your MySQL setup, of course, and whether you've managed
> indexes properly, but I've seen benchmarks where PHP/MySQL can serve pages
> *as fast* as static HTML. Now, that's speed. Not sure what's faster,
> though: reading MySQL data or parsing a session file. The file session
> handler uses the serialze() and unserialize() functions, I believe, so you
> could test this in simulation by yourself by serializing a bunch of data,
> dumping it to a file, and re-reading it. Then, do the same with MySQL. On
> the MySQL side, however, you won't need to write everything back to the
> table at the end of each page load. With sessions, session data must be
> re-persisted after *every* page load (or when the session ends, whichever
> comes first). This alone may be an argument in favor of a MySQL approach
> instead of sessions.
one thing too to point out is that mysql uses files under the hood to
store data. However, one thing you can do is increase the amount of
dirty data that is stored up before each i/o write. This could improve
performance; since the data is session data you probably are not to
worried about data loss if the power should go out. :) then again it
might be detrimental to the site.
the cool thing is that you have many options to persue.
--
ray
More information about the UPHPU
mailing list