M
M
MaxPyane2018-12-06 21:45:42
Sphinx
MaxPyane, 2018-12-06 21:45:42

How to solve this nuance when upgrading Sphinx to v3?

The essence of the problem is this, maybe someone came across.
Was on version 2.2.10, decided to switch to 3.0.3. I noticed huge changes, for example, with the same number of records in the database, the final size of the index on the 3rd version is two times less than on the 2nd version. I was delighted, but when it came to pulling data from the new Sphinx, it was a complete disappointment.
There seems to be no problems with the search itself, but the whole trouble is different. My site has pagination support from the 1st page to the very last one. That is, the user can take and go to the very last page or to any other. Don't ask why, long story, it's necessary. To jump across all pages, I did it on version 2 like this:

$cl->SetLimits(($page - 1) * $perPage, $perPage, 500000); // 500k это с запасом

And actually an empty query to get the latest records (there is also sorting by ID in descending order, let's omit this): The whole problem lies precisely in SetLimits. Setting max_matches with a margin for Sphinx 2 (otherwise it will never hit the end, even the center) does not create any problems at all. Queries are executed instantly, everything is as it should be (in the index of records, by the way, more than 200k). But in the 3rd version, such a thing does not work, i.e. it works, but the new Sphinx, with only such a request, devours all the RAM on the server and everything eventually comes to the point that the OOM killer demolishes it. With the default max_matches, which is 1000, everything works well and quickly, you can of course increase it, but how much RAM is enough. What to do? Been searching for two days now. I don't really want to remove the feature from the site.
$result = $cl->Query('', 'articles delta');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2018-12-06
@opium

Roll back the sphinx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question