load values into a memcache
ecahill at corp.untd.com
Thu Mar 8 07:14:14 UTC 2007
Well, unless the hits are all distinct, warming the cache with a small
amount of big winners might be nice. That said, a script to populate
memcache from a table is near trivial, and not SFAIK, included anywhere
the memcached distro.
Good luck and congrats on the traffic.
From: son at raider.co.nz [mailto:son at raider.co.nz]
Sent: Wednesday, March 07, 2007 3:20 PM
To: Cahill, Earl
Cc: memcached at lists.danga.com
Subject: RE: load values into a memcache
> I would suggest you hit the database and fill the cache only as
> come in. If you have some notion of high-trafficked keys, you could
> perhaps warm the cache appropriately.
> If a given key gets a ton of hits, it will quickly be in the cache.
> a given key gets no hits, well, why would you want it in the cache?
Thank you for your suggestion. My problem is my site may have ton of
for a second (eg. 2000 hits/second).
My application is redirect url. If a user enter a url, he will be
redirect to another one. So it needs fast. I store keys is "from_url"
value is "to_url"
If I call database for a request (of course, this request is not in
memcache yet), I may miss some hits as a query need a time to get back
ONly when I need to add a redirect (from_url and to_url), I will update
More information about the memcached