I've got some frequently-accessed data I'd like to store in RAM
between requests. I'm using Sinatra so I'll probably just use an LRU
cache in a @@class variable. I think I can muddle through all the
technical issues but one:

How big can I reasonably make my cache? I.e. how high (or low) should
I put my threshold before I start expiring unused data?

The only guidance I could find from a quick perusal of heroku.com was
on http://legal.heroku.com/aup: "Dyno RAM usage: 300MB - Hard" --
which is good to know, but not a complete answer. I'll obviously want
to set my cache well below that limit. But without monitoring tools I
don't have any idea how much RAM is used by the normal processing of
Rack + Sinatra per request, nor do I know how many requests are being
serviced per second. My cache is supposed to increase performance, not
decrease it by hammering the dyno into swap space, or otherwise
interfering with other system functions on the dyno.

So... any ideas? Has anyone else done this? Are there any low-level
monitoring tools I can use to find out how much RAM I'm currently
using, or how loaded the system is, or anything of that nature? Would
New Relic help here (and does it work for Sinatra apps)?

BTW, although I may want to use memcached as an *additional* caching
layer, what I'm interested in exploring now is the feasibility of
storing transient data in the app server itself. (I don't want the
overhead of instantiating Ruby objects, especially ActiveRecord
objects, not to mention that memcached isn't officially available as
an addon.)

---
Alex Chaffee - [email protected] - http://alexch.github.com
Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch |
http://alexch.tumblr.com

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" 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/heroku?hl=en.

Reply via email to