[Zope] SQLSession and Performance issues
Hung Jung Lu
hungjunglu@hotmail.com
Thu, 02 Mar 2000 14:46:22 PST
timothy grant <tj-@avalongroup.net> wrote:
>I am curious as to what methods may be used to reduce calls to
>SESSION['varname'], or if I am even barking up the right tree.
I guess it depends on what database you are using. If your
database is a remote server hooked up through TCP/IP port,
too many calls to SESSION could be bad. Also, if the session
data is large, during the transimission many packets have to
be send.
I don't have an answer... maybe you could describe first
what database you are using (Gadfly on the same machine?
remote database?), do you do many retrievals and updates?
------------------------
In the code SQLSession.py, there is a 'caching' variable.
SQLSession seems to cache variables that are already
retrieved or are recently updated. Try to set 'caching'
to 1 and see if that helps.
------------------------
As Pavlos Christoforou said, another strategy is to
have a single session data variable (a dictionary,
for instance), and then retrieve it, say, in your
standard_html_header and store it in your standard_html_footer
(or their equivalents.) This way you only need to access
the database twice per request.
------------------------
Please post back... I am also very interested. You
can also time performance by calling time.time()
in Python or <dtml-var ZopeTime> in DTML. I am
curious in the source of the problem... It would be
nice to find out whether the time is spent in each
database query or in TCP/IP packet splitting/joining/waiting.
regards,
Hung Jung
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com