Jump to content

Best way to use Sphinx for two forums on the same server?


Recommended Posts

What's the best way to use Sphinx for two communities on the same server? Should I install a copy of Sphinx for each one, or can one instance of Sphinx handle both of them (if so, how would I go about setting it up that way?)?

Link to comment
Share on other sites


I would run 2 instances of Sphinx, and then set crontab up to run the indexers at different intervals to minimise the load.


Its probably not the *best* way, but certainly the easiest.




Does that involve installing Sphinx twice, or just running two instances of the same installation using different sphinx.conf files?

I'm not looking for the easiest way to do it, but rather the way that will save the most server resources.
Link to comment
Share on other sites

Sphinx can run multiple instances of the daemon, but each instance adds more overall server load than using a single instance, for multiple Boards running 3.2.2 (which are set to use the Sphinx Prefix feature).

Please see this page:

http://community.inv...-up-sphinx-r181

for general instructions on a single-forum install. The only thing needed for a multi-forum install is to:

1) On each forum, it has to be Board version 3.2.2
2) Go to ACP -> System Settings -> Search Set-up -> fill in a value for Sphinx index prefix. It's suggested to use the account name (since that must be unique per-server) with an underscore, i.e.: account-name_
3) Set the search type to "Sphinx" at the top of the page. Save the settings page.
3) Build the sphinx.conf files for each forum.
4) Edit all of them, picking ONE copy as a "master". In this one copy, you leave ALL information. For the other installs, you need to cut PART of the contents out to paste in the "master" copy. What to cut out is easier to visualize than describe, but basically, for the non-master copies, you select everything from the top down, but NOT including the "Indexer Settings" section at the bottom. Then you paste that into the "Master" copy, anywhere AFTER the top section for the first forum, but before the bottom section mentioned, and to avoid confusion it's suggested that you paste it after the existing sections of the "Master" copy (but again, before the last section titled "Indexer Settings").

That's the brief version, but it works fine. We use it that way on our Advanced Hosting packages. The suggestion to run multiple instances so you can stagger the rebuilds is a good idea, but it takes considerably more administrative work to do it.

Link to comment
Share on other sites


Sphinx can run multiple instances of the daemon, but each instance adds more overall server load than using a single instance, for multiple Boards running 3.2.2 (which are set to use the Sphinx Prefix feature).



Please see this page:



http://community.inv...-up-sphinx-r181

for general instructions on a single-forum install. The only thing needed for a multi-forum install is to:



1) On each forum, it has to be Board version 3.2.2


2) Go to ACP -> System Settings -> Search Set-up -> fill in a value for Sphinx index prefix. It's suggested to use the account name (since that must be unique per-server) with an underscore, i.e.: account-name_


3) Set the search type to "Sphinx" at the top of the page. Save the settings page.


3) Build the sphinx.conf files for each forum.


4) Edit all of them, picking ONE copy as a "master". In this one copy, you leave ALL information. For the other installs, you need to cut PART of the contents out to paste in the "master" copy. What to cut out is easier to visualize than describe, but basically, for the non-master copies, you select everything from the top down, but NOT including the "Indexer Settings" section at the bottom. Then you paste that into the "Master" copy, anywhere AFTER the top section for the first forum, but before the bottom section mentioned, and to avoid confusion it's suggested that you paste it after the existing sections of the "Master" copy (but again, before the last section titled "Indexer Settings").



That's the brief version, but it works fine. We use it that way on our Advanced Hosting packages. The suggestion to run multiple instances so you can stagger the rebuilds is a good idea, but it takes considerably more administrative work to do it.



Thanks for the detailed instructions, Mark! They make more sense while looking at the sphinx.conf files. :tongue: I managed to get a single Sphinx daemon running for both of my communities now. I think you should have these instructions as part of the documentation for those of us running multiple communities.

I'm not too worried about staggering the index rebuilds - I'd rather have just the single daemon running to conserve RAM throughout the day. The indexes rebuild quite quickly, anyway, even for two forums.
Link to comment
Share on other sites


Please see my revision to the post! I Misspoke about the top section. :wink:



Haha, I figured that part out. :P I realized that Sphinx would need to know how to access both of the forums' databases. But thanks for following it up - others who come across this thread might've been confused.
Link to comment
Share on other sites

Multiple daemons actually worked better for me. Try it both ways, and see whats for your specific site. Sure a lot depends on volume, mysql engine, and so on. Either way the posted instructions will work but with sphinx 2.0 and higher I could not get it to honor prefix. Easiest work around I found was run the listening on different ports. In the .conf file of the second daemon just change
listen = 127.0.0.1 to listen = 127.0.0.1:9313
A little dirty, but makes it easy, and config files get changed all the time anyways.

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.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...