Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

For speed/reliablity and ease of use with the less server resource usage, which Session module or system do you prefer?

We use Apache::MySql::Session and have used it for years, however, we have so many members it does appear to use more server resources. So I am thinking of over hauling our whole system to use another session system.

Please let me know what you recommend by your experience if you do not mind.
thank you,
Rich

  • Comment on what is the best session module to use?

Replies are listed 'Best First'.
Re: what is the best session module to use?
by Anonymous Monk on Nov 03, 2009 at 07:59 UTC
    We use Apache::MySql::Session and have used it for years, however, we have so many members it does appear to use more server resources.

    Apache::MySql::Session? This probably has more to do with how you're using Apache::MySql::Session, than anything Apache::MySql::Session does. Maybe you want to index your session table?

      table only has 3 fields:

      t which is the timestamp field,
      id which is the primary key so already part of the index
      and a_session which is a text field so cannot add an index, I did just add a 'fulltext' index so we'll see if that helps. Anyhow, if you or anyone else knows of a better session control system please let me know what you recommend.

      thanks,
      Richard

Re: what is the best session module to use?
by Unforgiven (Hermit) on Nov 03, 2009 at 13:55 UTC

    Do you really need to use a database as the backend? For example, if it's just a single server, ditch all that overhead, and use something simpler like plain old CGI::Session.

    If you do, maybe something like memcached would be better? Remember, it's just a session, which is essentially just a key-value store anyway.

      Well, we have over 60k members so the sessions are necessary to be quick and efficient, to store information such as keys, usernames, session data such as preferences for that session and so forth.

      Can text sessions do the same thing? Are they faster than database sessions?
        I haven't used a database backend for sessions, so I couldn't honestly say, but I'd certainly try it. Think of the overhead of using a RDBMS, as opposed to a simpler method. I could be wrong, but I think it's at least worth considering. And if you need something accessible by multiple machines, like I mentioned, there's memcached, which is designed for this sort of thing to begin with (and easy to set up, too, based on my brief experimentation with it). On the other hand, if it turns out that I'm wrong or if someone else knows better, feel free to tell me, too.
Re: what is the best session module to use?
by Anonymous Monk on Nov 05, 2009 at 08:06 UTC
    I think part of the problem is that there is once in a while this in the database connections (sometimes quite a few of them):
    SELECT GET_LOCK('Apache-Session-d4583495319f3c9c3cd50w0a9f2b2ce7', 360 +0)
    Anyone know why it would do that?