Re: svn commit: r290569 - /httpd/mod_python/trunk/lib/python/mod_python/SQLiteSession.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: svn commit: r290569 - /httpd/mod_python/trunk/lib/python/mod_python/SQLiteSession.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: svn commit: r290569 - /httpd/mod_python/trunk/lib/python/mod_python/SQLiteSession.  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 01:47 AM

Gregory (Grisha) Trubetskoy wrote:

> I think it might be interesting to see something like an ANSI SQL-92
> compatible session with some suggestions on how it can be easily
> integrated with your database vendor of choice, but deifinitely not
> support specific database vendors, except for those whose support exists
> natively in the Python distribution (which is none at this point).
> 
>
>
> ...so nothing unique about sqlite? If so, I don't think it should be
> part of mod_python unless/until it is standard in Python, then we can
> discuss it.

Thinking about the session code, there is at least one big advantage to
any SQL backend. One of the bottlenecks in both DbmSession and
FileSession is in the expired session cleanup code.

In DbmSession the cleanup code must iterate over *all* of the dbm
records and unpickle each one to determine if the session data should be
deleted. Needless to say this does not scale at all.

FileSession is better or at least when the cleanup code runs it won't
DOS the server. Again, we must iterate over all the session files to
determine which ones have expired and should be deleted. I think I put
some fairly clever things in there to make it scale, but I know it's not
ideal.

Contrast this with the cleanup for a SQL backend which would be as easy as:
DELETE FROM sessions WHERE expires < current_time - timeout;
assuming the sessions table has the expires and timeout fields updated
from the session data when the db record is updated (or inserted).

Thus a SQL backend would scale in a way that DbmSession or FileSession
cannot. Granted, this is not unique to sqlite, but it is an argument for
have some kind of sql session class.

Regards,
Jim






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:20 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register