Joseph - Thanks for the link!! I did see this project earlier when hunting for some info on the GAE memory behavior...
The system looks great. I was hoping to however store 'plain' python objects in RAM on the serverside - the reason for this is to not incur any quota 'hits' by hitting the datastore... also I didn't want to have to restrict to only pickle-able objects for the session data. The way I was hoping to architect my application - highly volatile / complex data structures would be stored in the server's RAM as plain python objects, critical data stored into the datastore - and if the GAE invalidates the memory of my application serverside I would re- construct those RAM structures algorithmically from some info stored in the datastore. Which is why it was critical for me to know how much memory I had to work with... how often GAE will invalidate my serverside data structures and if I should expect my user's requests to be hitting instances of my application on different servers / with different IPs / etc.... if anyone has any info/tips on the rules GAE uses or how it behaves I would love to hear!!! Otherwise I will continue down the route of experimentation... I'll update this list if I can find anything, thanks, On Oct 31, 1:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If you're trying to persist sessions per user across the datastore, > gaeutilities already has a class you can use for that which uses both > memcache and the datastore. Reads go to memcache first and then to the > datastore if it's not found in memcache (memcache can't be trusted to > be persistent). > > If you're looking for something which can store data for all sessions, > gaeutilities also has cache, which uses the same memcache/datastore > logic. It also allows you to set expiration dates on the individual > cache items. These cache items are accessible by all requests. > > Both use standard Python dictionary methods for access > > session['user'] = "bob" > cache['myhit'] = "hit" > > Both also support storage of any object that can be pickled, so you > can store dictionaries, lists, and such. > > http://gaeutilities.appspot.com/ > > On Oct 31, 1:43 pm, sal <[EMAIL PROTECTED]> wrote: > > > Nikola - thanks much for your input, I've been researching this for a > > day or so now... and have found some things out in case anyone else is > > wondering also. > > > It looks like you can declare 'global' variables, and they stay in the > > server's memory across all HTTP requests. I've created a hashmap > > (err... what was the python version again? dict? :) I'm a J2EE guy) > > and am using this to store a map of session cookies to the user's > > requests, so I have now a working session. > > > I still don't know how long the data in these global variables will > > persist, or how much memory I have allocated to use, and I'm only > > working locally on the SDK so I haven't tested on GAE yet. I am > > planning to extend the session manager I created to work with memcache > > and datastore to automatically persist sessions if/when I do find out > > the real limits. > > > The other question still open - is if GAE will be splitting multiple > > HTTP requests over multiple copies of my 'in memory globals' > > simultaneously... this will cause some more issues to work around... > > if anyone has experience with this yet do let me know!! > > > Thanks, > > > On Oct 31, 7:52 am, Nikola <[EMAIL PROTECTED]> wrote: > > > > GAE has no "global memory" - every handler runs in it's own address > > > space. You can persist data in the datastore (perhaps caching with > > > memcache for performance), or in browser cookies. A lot of > > > applications can do with the Users API instead of full-blown sessions. > > > > -Nikola > > > > On Oct 30, 10:11 pm, sal <[EMAIL PROTECTED]> wrote: > > > > > I tried to RTFM a bit on the topic and wasn't able to find what was > > > > needed - if someone with more App Engine experience could point me in > > > > the right direction that would be great! > > > > > I understand that any cloud computing environment needs to allow for > > > > dynamic allocation of computing resources - I am just looking to > > > > discover what some of the operating parameters are so I can avoid > > > > errors with my apps. My questions: > > > > > - Regarding the behavior of regular python data structures: Assume I > > > > have an object (an instance of a class) in global memory (for > > > > performance reasons) which contains various fields holding values. > > > > How long will a single user's web requests hit the same instance of > > > > that object? Will multiple requests ever go to different 'cached' > > > > instances of that object or another instance of that in-memory data > > > > structure located on a different server? Do I need to anticipate > > > > requests coming from the same user going to different web servers that > > > > have independant cached versions of my application's data structures, > > > > simultaneously? > > > > > - How much 'memory' or 'ram' (Regular python memory') can I consume > > > > via my python code... in the form of lists, Strings, dicts, etc. > > > > before I encounter an exception? Is the limit per-user-session or per- > > > > app? > > > > > - I noticed from limited testing that there is at least a small > > > > semblance of a session... what is the token used to arrbitrate them? > > > > ie: does GAE use a browser cookie, the IP of the user - or a cookie > > > > containing the user id? (I want to make sure that I don't invalidate > > > > whatever the mechanic is, so I don't destroy the user's sessions) > > > > > I'll try to keep searching documentation for some answers... if anyone > > > > can point me to any info in the right direction I *greatly* > > > > appreciate, in advance, all your help, > > > > > - Sal --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
