At 10:56 AM 1/4/02 +0000, Costas Malamas wrote:

>I am considering caching an array of objects as a Session variable, so 
>that it can persist across page views. I am thinking just 50 elements or 
>so will be enough, with a re-caching hook at the end --which is a nice 
>excuse to play with iterators :-)
>
>Now, I have a couple of questions for all of you webware gurus:
>
>1.  Assuming the size of an object is, say, ~512 bytes, at 50 items that's 
>~25k per session.  These days it's not much, but if I get so lucky as to 
>have say, 100 concurrent users, we're talking 2.5MB of RAM, which is not 
>much these days, but the purist in me worries: what happens with hanged 
>sessions, sessions that have been abandoned and are still hanging around, 
>etc?  So, I guess my question is, how does WK handle storage of session 
>variables, i.e. transition from in-Ram to .ses files, balancing of 
>resources, etc.

If you use the Dynamic session store (which I recommend), recently-used 
sessions will be stored in memory, and inactive sessions will be moved to 
disk and then deleted when the session expires.  You can also specify a cap 
on the maximum number of sessions in memory.  See 
http://webware.sourceforge.net/Webware/WebKit/Docs/UsersGuide.html#Config_Application 
and pay particular attention to the settings that have "Session" in their name.

>2.  How can I eyeball how much memory each object will take? is the size 
>of a pickled representation good enough? (i.e. what happens in RAM to 
>methods of an object, etc?)

I suspect the pickled representation is smaller than the amount of RAM 
used.  You might want to just write a test script that creates a bunch of 
the objects you're interested in, and measure how much RAM is used up.

>3. OT: is there a way to clean up the URL sent to the client? i.e., if a 
>form is sending a massive GET to a servlet, can this servlet take out all 
>the ?a=x&b=y crap ?

I don't quite understand what you need.  HTTPRequest.py has a number of 
functions that return various bits of the URL -- probably one of them will 
do what you want.


--

- Geoff Talvola
   [EMAIL PROTECTED]

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to