> So you are saying that a database access is faster than a file access? I find
> that hard to believe, but do not have any evidence of the contrary.

As a general rule of thumb, databases are faster for small bits of
data and the file system is faster for larger data.  Both the
filesystem and the database have memory caches, so reading data from a
file or the database repeatedly doesn't require going to the disk.

The problem with php sessions is that they force a write on every
request, which requires going to the disk every request.  This could
be mitigated with memcached or memory tables, but that has a whole
host of other problems.  I think if i had a session performance
problem (which I don't) I'd use a hybrid database/memcached solution
that only writes if the session has actually changed.  That way, you
would only have to hit the disk if required and your would be able to
restart mysql/memcached without destroying every session.

Regards,
John Campbell
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to