I did some experiments with Shopify's identity_cache 
<https://github.com/Shopify/identity_cache> and saw some speed improvements 
from it. Since I can see there has been others asking about using memcached 
with TS, I thought I would post a brief howto here. Mind that I haven't had 
time to test this thoroughly, but since most of the heavy stuff happens 
within identify_cache, I would expect everything to run more or less smooth.

First you will need to install identity_cache and configure your models to 
use it. To have TS use fetch instead of querying the db directly, I made a 
custom piece of middleware, that extends the default ActiveRecord 
hydration: https://gist.github.com/troelskn/724353e3228f4f9921df

Drop the file in e.g, lib/identity_cache_middleware.rb and require it in an 
initializer. That's all there is to it really. To verify it works, watch 
the rails debug log for lines from IDC.

I ran a small test on a copy of our production setup and saw some pretty 
good figures: https://gist.github.com/troelskn/fca41034ab3ebed4f507

Hope that helps someone,

Troels

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to