On Jun 25, 2008, at 1:33 PM, Ben Bangert wrote:
> On Jun 25, 2008, at 10:59 AM, Jonathan Vanasco wrote: > >> if i were you, the next thing i'd do to optimize is offload the DB. >> if you're db heavy and you've got a system that big, you're hitting a >> mem+cpu issue. i wouldn't be surpirsed if you could quadruple >> pylons' >> performance once the db is moved. > > Yep, no doubt, but its fast enough at the moment, so I'm in no > rush. :) > >> That's a GREAT tip. I missed that in the docs. >> >> Wondering something about the Mako templating though... >> - are templates served from memory or processed through the data/ >> templates dir on every request ? > > Templates are compiled to actual Python modules, if you look in your > data/templates dir, you'll see the Python modules it made. Python > then of course compiles the modules to .pyc's, which is part of what > makes Mako so fast. You're running Python byte-compiled modules for > templates. So they're served from the compiled Python modules. > >>> 2) Use cookie-based sessions, to avoid hitting the filesystem >>> loading >> cookie based sessions are the devil. >> the best option would really be memcached > > Since memcached operates on a LRU principle, storing sessions in > memcached isn't a good idea unless you want people randomly logged > out of your site when memcached needs to clear something, and > someones session happens to have been accessed less frequently than > something else. Cookie-based sessions work, and in Pylons can be > encrypted with 256-bit AES, in addition to the SHA-256 HMAC > signature to ensure no tampering takes place. Of course, you still > need to check that the user in the cookie is actually logged in > (usually by looking at a database), which kills some of the > advantage of the cookie-based session to begin with. If you had a > separate memcached just for sessions, that you set high enough to > ensure your max amount of users have enough space to avoid memcached > dropping the data, that might work as well. > > Cheers, > Ben We use a separate memcached instance for sessions and it works wonderfully. We've found our average session size is about 10K. With a small 256MB memcached instance, we can store well over 20,000 sessions. TJ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
