Jump to content

Optimized sphinx.conf that uses ranged queries


Recommended Posts

For those who are interested, I have made available a sphinx.conf that uses ranged queries. If you are using MyIsam mysql tables and find that you are getting table locks when rebuilding Sphinx every night, this config should help alleviate these issues.

After I upgraded to version 3.4.2 from 3.1.4, my server was getting table locks doing the nightly rebuild. I hired Percona, a well respected MySQL support company, to resolve this issue and they suggested ranged queries in the Sphinx rebuild process. This has reduced the table locks on my server, though the DB server will run slowly while performing the index. I offered this file to Matt and Brandon to include in the base distribution, but never heard back, so I thought I would offer it to the community directly.

The new sphinx.conf file can be found here:

http://www.bleepingcomputer.com/misc/sphinx.conf

Please note that when using this new conf, make sure the table names match up with what you are using. Some sites may be using a $INFO['sql_tbl_prefix'] in their conf_global.php and will have to adjust the config accordingly.

Hope you find it useful.

Link to comment
Share on other sites

  • 1 month later...

For those who are interested, I have made available a sphinx.conf that uses ranged queries. If you are using MyIsam mysql tables and find that you are getting table locks when rebuilding Sphinx every night, this config should help alleviate these issues.

After I upgraded to version 3.4.2 from 3.1.4, my server was getting table locks doing the nightly rebuild. I hired Percona, a well respected MySQL support company, to resolve this issue and they suggested ranged queries in the Sphinx rebuild process. This has reduced the table locks on my server, though the DB server will run slowly while performing the index. I offered this file to Matt and Brandon to include in the base distribution, but never heard back, so I thought I would offer it to the community directly.

The new sphinx.conf file can be found here:

http://www.bleepingcomputer.com/misc/sphinx.conf

Please note that when using this new conf, make sure the table names match up with what you are using. Some sites may be using a $INFO['sql_tbl_prefix'] in their conf_global.php and will have to adjust the config accordingly.

Hope you find it useful.

I wanted to thank you SOOOOO much. This saves me 30 minutes of downtime per day!

Link to comment
Share on other sites

Your very welcome. I sent this off to Brandon and Matt and never received a response back. As there does not seem to be any disadvantages to using the ranged queries, I hope they would consider using this in their default sphinx.conf.

Seems like a win win to me.

Link to comment
Share on other sites

Hi Brandon,

I just looked and it seems I sent it to only Matt. Could have sworn I included you, but I guess I didn't. Apologies for the confusion.

Real time indexing would be terrific. Would eliminate both the need for ranged queries (table locks) and obviously the benefits of the of having an almost real-time index.

Link to comment
Share on other sites

  • 4 weeks later...

I went ahead and used your configuration, but I'm still having nightly crashes with my table locking up.

So I modified the sql_range_step from 1000 to 500. And I also modified the sql_ranged_throttle = 1000.

Has anyone attempted to fiddle with these settings with good results? Is there any other settings that might prevent nightly crashing with Sphinx reindexes its search database?

Our forums board is huge with over 105,000 members and 1.8M posts. I'm trying my best to prevent a table lockup.

Link to comment
Share on other sites

The settings continued to shut down the server with sql_range of 500 and 1000. I also increased the sql_ranged_throttle to 3000 to try and solve it -- but to no avail.

Is there a way to throttle this script to prevent the shutting down of the site?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...