Search code examples
searchwikiscrewturn

Screwturn Wiki Search Latency


Does anyone know of ways to optimize the screwturn search functionality? We've been using it for internal documentation, and I'm the tech expert on it, but I have not had the opportunity to analyze it much. After inputting a lot of information into it, we've noticed that text searches take a noticeable delay; on the order of up to 10 seconds in some cases. I'm pasting a screengrab of the search index status here. We have a good 30 different namespaces, which I suspect is more than we really need, but the decision was made to use them for organizational purposes, and I couldn't think of a reason why not. Is it possible the high number of namespaces impacts the search time?

When doing tests on the search, the only resource spike I could find was a big CPU usage spike on the webserver.

Search Index Status screengrab


Solution

  • If you profile the SQL for a single search from your original question, you will likely notice that the web app is very chatty with the database. Having a larger number of namespaces to search will have an impact on search performance due to the way the search is performed (by namespace, from what I have seen, seems very inefficient). After reviewing the code a bit, I can see where you might see a spike on the web server. The best bet would be to refactor the search function to work better with a larger # of namespaces.