The sky is blue. The water is wet. Runaway queries can clog up your entire cluster. Search results within a guaranteed 200 ms response time are mighty nice to have. Accounting of CPU/disk use over a cluster is crucial for a SaaS provider. What is this all about and how do these seemingly unrelated and random things connect? In Sphinx, they all connect via a neat feature we added a while ago, the so called "predicted query time"
and the associated counters and directives. The specific keywords are max_predicted_time, predicted_time_costs, and SHOW META. And in this post, I'll show you in detail how to use those to nicely limit the runaway queries, OR guarantee stable search results within a given timeframe, give or take a few milliseconds, OR keep track of customer resource use. Interested?