Search code examples
ruby-on-railssphinxthinking-sphinx

Dedicated database server setup. Where should my Sphinx and Thinking Sphinx configurations/indices go?


Using Rails 3.2, Thinking Sphinx 3.0.6, Sphinx 2.2.4-id64-beta.

I am setting up a dedicated database server for my app. May I know the following:

  1. Where should I install Sphinx? App server or database server?
  2. Is the following /path/to/app/server/current/config/thinking_sphinx.yml correct: address: database_server_ip_address pid_file: /path/to/app/server/shared/pids/searchd.pid indices_location: /path/to/app/server/shared/db/sphinx configuration_file: /path/to/app/server/shared/config/production.sphinx.conf

Solution

  • It probably depends on where you want to avoid latency. If it's on the database server, then indexing will be fast, but search queries may be a bit slow (granted, they're just facing the same hit that database queries are, so I'd hope that was negligible either way). If indexing's not too hard and you want that extra touch of speed, then having Sphinx on your web server might be better.

    That said, you're more likely to scale up the number of web servers, so having a single Sphinx daemon on the database server is probably the better way to go.

    As for the options - they look correct (the paths are outside of the current directory or any specific release). You'll just want to make sure the actual directories exist.