== The configuration files Please note that the generated .conf file in config/ultrasphinx should not be modified by hand. This is the configuration for Sphinx itself, and includes all the generated SQL. It is never the same as the .base file. You will want to keep your generated production.conf in your repository. You can get a production.conf by running: RAILS_ENV=production rake ultrasphinx:configure If you don't have local read access to the production database, you'll need to write a post-deploy task to generate the configuration server-side. It is important that every checkout of the app has a copy of production.conf. It is not enough to only have it on the server where the search daemon is running--Rails uses it too. You will not want to keep the generated development.conf in the repository. This helps to catch bugs by discouraging out-of-date configurations. == Indexing and monitoring It's easy to keep the search daemon and the indexer running in a production environment. Cronjobs are the best way: */6 * * * * bash -c 'cd /path/to/production/current/; RAILS_ENV=production \ rake ultrasphinx:index:delta >> /log/ultrasphinx-index.log 2>&1' 1 4 * * * bash -c 'cd /path/to/production/current/; RAILS_ENV=production \ rake ultrasphinx:index:main >> /log/ultrasphinx-index.log 2>&1' */3 * * * * bash -c 'cd /path/to/production/current/; RAILS_ENV=production \ rake ultrasphinx:daemon:start >> /log/ultrasphinx-daemon.log 2>&1' The first line reindexes the delta index every 10 minutes. The second line reindexes the main index once a day at 4am. The third line will try to restart the search daemon every three minutes. If it's already running, nothing happens. Note that you can use ultrasphinx:index:merge in place of ultrasphinx:index:main. It will be faster, but will not remove deleted records from the index. Of course if you don't have any models with deltas, don't include the ultrasphinx:index:delta task. If you are under severe memory limitations you might want to manage the daemon with Monit instead, so you can keep a closer eye on it. The search daemon is extremely reliable, so don't bother with fancy monitoring infrastructure unless you're sure you need it. == Gotchas If you change the field configuration or model set, you will need to rerun rake ultrasphinx:configure to update the .conf file. Make sure to completely stop and restart the search daemon when you deploy a changed .conf. It will not reload it automatically.