Memcaching sphinx results - good idea or bad idea?
We maintain a fairly large sphinx store. about 3.3 million records. we also maintain a fairly well dist开发者_如何学运维ributed memcached base set over 4 servers.
We were just wondering if it is advisable to store sphinx results for various queries in memcached, which would be fairly easy to implement.
While I understand this can be a somewhat broad question, but just any general ideas?
Also worth mentioning, the memcached connection is always made in the script that accesses sphinx. total connection times (sphinx + memcached vs just memcached) could be improved. then again, all queries that do not result in a memcached hit would end up having to send a write to memcached.
So, would it be a good idea to store sphinx results in memcached for future use?
Thanks!
It is depends on your situation and on your needs. In your projects we had the same architecture, where memcache caches sphinx search results. But, in general, in our projects, it was minor chance that needed search query results are already in cache. That was about 10% of all queries because of large variety of queries and not guaranteed long-time storing data in memcache. Further more, sphinx usually searches very fast. So, we decided not to use cache in search. So, you need to do tests. They will tell you.
精彩评论