I am writing a web application for which I use Sphinx to search for about a million documents.
The performance is excellent: a typical request takes only 0.05 seconds, but if the requests are not executed for several hours, then for several requests this takes much longer - up to 1000 times longer, and then returns to normal. The query log is as follows:
[Wed Mar 7 17:23:55.937 2012] 0.221 sec [Wed Mar 7 17:32:00.726 2012] 0.012 sec [Wed Mar 7 17:32:00.984 2012] 0.052 sec [Wed Mar 7 17:32:01.416 2012] 0.222 sec [Thu Mar 8 09:15:10.418 2012] 10.147 sec [Thu Mar 8 09:16:00.560 2012] 48.262 sec [Thu Mar 8 09:16:55.429 2012] 54.153 sec [Thu Mar 8 09:17:54.454 2012] 0.012 sec [Thu Mar 8 09:17:54.713 2012] 0.052 sec [Thu Mar 8 09:17:55.141 2012] 0.218 sec
I assume that my busy server changes Sphinx memory when not in use or something like that.
How can i solve this?
I reviewed scripted fake requests every minute, but this seems like a pretty ugly hack.
source share