Closed Bug 460211 Opened 16 years ago Closed 16 years ago

Implement memcache for new sumo search

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nkoth, Assigned: lorchard)

References

Details

(Whiteboard: sumo_only)

Attachments

(1 file, 2 obsolete files)

There are already caching hooks. To attach memcache hooks and test.
Target Milestone: --- → 0.7.2
Blocks: 460213
Blocks: 460214
Target Milestone: 0.7.2 → 0.7.3
Les, do you have time to look at this this week?
Assignee: nobody → lorchard
This should be implemented where it is commented in /webroot/tiki-newsearch.php.
Starting to look at this, but it seems like the caching here is intended to be different than the way I've done it everywhere else so far.

The memcachelib itself is really simple, so might be easier for someone more familiar with the search code to drop it in.  

Alternatively - are there docs somewhere on how to get this search code working?  I haven't had much luck so far.
(In reply to comment #3)
> Starting to look at this, but it seems like the caching here is intended to be
> different than the way I've done it everywhere else so far.

I suppose it will be different since we are caching search results rather than pages or things like that.

> 
> The memcachelib itself is really simple, so might be easier for someone more
> familiar with the search code to drop it in.  

Eric, would you have time for this?
Paul, would you have time to investigate this?

> 
> Alternatively - are there docs somewhere on how to get this search code
> working?  I haven't had much luck so far.

Follow procedure here. bug 463708 for background Sphinx install instructions. Sphinx is required for the new search.

Do this: bug 464851

User tips: Bug 460224
I'll know by the end of today what time I'll have before Tuesday. My initial thoughts would be yes, though.
I haven't gotten sphinx working for my dev instance yet, but for what it's worth if someone else with working sphinx takes a crack at this:

An example of what I did with memcache can be seen at the start and end of tiki-view_forum_thread.php, buffering and caching page output.  Sounds like the search caching is meant to be much finer grained to cache just results, but the basic usage of the memcachelib.php I threw together should be the same.

The main tricky bit I found is if there's a need to cache results of any kind for multiple locales, and then to invalidate the caching for a whole family of results. (ie. a forum thread or wiki page for a range of locales)  This might not be a concern for search results - but if it is, that's what the "meta-time" datestamp helps facilitate.
I cooked this up in a rush this morning (since sphinx and the new search work on my dev). It seems to do the trick. It caches an entire query's result array, which seems to have been the intention.

A minor note, no "meta-time" checks (see above comment) are done like they are for wiki pages and forum threads. If it's a concern, it'll be easy enough to add.
Attachment #349589 - Flags: review?(nelson)
Attachment #349589 - Flags: review?(lorchard)
Attachment #349589 - Flags: review?(lorchard) → review+
Comment on attachment 349589 [details] [diff] [review]
Adds memcache functionality to new sphinx search

Code looks good, but I've still not had a chance to get Sphinx working on my machine to run it.
Can you add an admin UI for turning on/off memcache caching for this, i.e. make the cache method a pref?
Attachment #349589 - Attachment is obsolete: true
Attachment #350103 - Flags: review?(nelson)
Attachment #349589 - Flags: review?(nelson)
Attachment #350103 - Attachment is obsolete: true
Attachment #350105 - Flags: review?(nelson)
Attachment #350103 - Flags: review?(nelson)
Comment on attachment 350105 [details] [diff] [review]
Patched from r20266

in r20269/r20270
Attachment #350105 - Flags: review?(nelson) → review+
I've tried it... Nothing breaks, but still waiting for search results from bug 464851 to enable more testing.

As for testing of memcache itself. Laura/Stephend, how does one go about testing the "effectiveness" of memcache? Must we schedule sometime with IT? I suppose that will be bug 460216?
Status: NEW → RESOLVED
Closed: 16 years ago
No longer depends on: 405028
Resolution: --- → FIXED
My experience with testing memcache (on AMO) is more or less limited to ensuring that memcache isn't holding onto things we want to display immediately; make a string change, change a graphic, etc., and ensure that the update is reflected on page load/reload.

I don't know how to test it otherwise, but oremj and/or morgamic et al. would know more, for sure.
Adding oremj and morgamic. See comment 14 from Herr Donner!
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: