The data are not the same or I can make this assomption since they can
change each time the controller function it calls... The controller take
parameters into vars and make db query and render a resulting table...
There is numerous differents parameters and the requested data are by
nature changing or say differently the interess about these data shift over
new available data...

Am I right in my understanding that session.keys get write into session
file only once when it get define for a given request and in the next
request if the session.key1 is still there (unchanged) it won't be re-write
to session file? At start I would just avoid that the session populated
data were not transported all around the app on each request for nothing...
If they get write once when they get created/updated and that there is no
overhead at having it there, I can leave with them, though if they stays in
memory (ram) it can start to be an issue if many user start to generate
these reports...

Thanks

Richard

On Tue, Nov 3, 2015 at 2:36 PM, Anthony <abasta...@gmail.com> wrote:

> Yes, simply making the check for the session keys to see if cleanup is
> needed should add minimal overhead. Likewise, if the deleting itself is
> infrequent (or if it tends to occur when you have other session changes
> that need to be written to the file anyway), then there shouldn't be much
> additional impact of writing the updated session. On the other hand, if
> you're constantly deleting and re-adding the same session keys request
> after request, it might not be worth it.
>
> Anthony
>
> On Tuesday, November 3, 2015 at 2:28:08 PM UTC-5, Richard wrote:
>>
>> Thank you Anthony, I appreciate you input... I was concern about exactly
>> that, I mean keep clean up the session each request has a cost... I will
>> need to make a check, it would be logic that if the session keys to be are
>> not present in session that the only overhead should be the clean up
>> funciton call and the session keys check...
>>
>> Thanks again
>>
>> Richard
>>
>> On Tue, Nov 3, 2015 at 2:19 PM, Anthony wrote:
>>
>>> On Tuesday, November 3, 2015 at 2:04:21 PM UTC-5, Richard wrote:
>>>>
>>>> There is large amount of that data that why I have this concern...
>>>>
>>>
>>> You might want to do some testing (i.e., checking response times and RAM
>>> usage) before bothering to manage session keys. Note, the session data for
>>> a given user is only loaded into RAM during the period of a given request
>>> (in between requests, it resides in the session file).
>>>
>>> If there is a large portion of the session that can safely be deleted at
>>> some point, feel free to do something like what you have suggested and just
>>> delete the relevant keys. One thing to keep in mind is that if the session
>>> doesn't change during a given request, web2py does not bother to write out
>>> to the session file, so if you do delete some keys, you will be prompted a
>>> file write during that request. The overhead of the extra file writes must
>>> therefore be balanced against the overhead of keeping the extra data in the
>>> session instead.
>>>
>>>
>>>>
>>>> Is cleaning the sessions/* files delete data put in session?
>>>>
>>>
>>> When you clean up session files, you are typically deleting files of
>>> sessions that have already expired (based on the Auth login expiration)
>>> and/or are presumed no longer to be active (based on the time since last
>>> modified). The entire file is deleted, so of course you lose all the data.
>>>
>>> Anthony
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to