[nycphp-talk] session variables size?
zaunere at yahoo.com
Sat Apr 19 18:36:10 EDT 2003
--- Marc Antony Vose <suzerain at suzerain.com> wrote:
> hi there.
> i'm just wondering if there is a problem with setting a large session
> variable, like performance-wise? i've been using session variables
> for years, but i always, for some reason, have kept them to just
> storing small stuff, rather than, like, a gigantic associative array
> representing search results or something.
If you're using the default session handler, it serializes the session data
(akin to serialize()) and then stores it on disk. Aside from the
serialize(), sessions are about as fast as you can get, concerning data
storage; baring storing everything in memory. If you were to write your own
session handler if performance really became an issue.
I don't know exactly what 'gigantic' means, but don't forget about stale
sessions. If the garbage isn't collected, or you're getting heavy traffic,
you could run into some space and disk contention issues.
More information about the talk