Вопрос

Using Rails 3.2 and Thinking Sphinx 3.0.6. When I checked the processes running on my production environment, I got this:

deployer@vps:~$ ps aux | grep search
deployer   401  0.0  0.0 102340  1588 ?        S    10:38   0:00 searchd --pidfile --config /home/deployer/abc/releases/1/config/production.sphinx.conf
deployer   402 47.0  0.7 248984 29944 ?        Sl   10:38   0:12 searchd --pidfile --config /home/deployer/abc/releases/1/config/production.sphinx.conf

There are 2 processes in Sphinx. Is this behavior right?

Everytime when I run ts:stop, it hangs, and I have to kill one of the processes manually to stop Sphinx. I'm not sure if this is caused by the two processes.

Update 1

My thinking_sphinx.yml:

production:
  pid_file: /home/deployer/abc/shared/pids/searchd.pid
  indices_location: /home/deployer/abc/shared/db/sphinx
  searchd_file_path: /home/deployer/abc/shared/db/sphinx
  config_file: /home/deployer/abc/shared/config/production.sphinx.conf
  mysql41: 9312
  mem_limit: 512M
Это было полезно?

Решение

Two processes is normal - TS v3 uses Sphinx's threaded workers (so, you're seeing the master process and at least one child).

As for the ts:stop issue - I presume this is via Capistrano? It's probably because the configuration file doesn't exist for the current deployed release. You should probably change the file location (using the configuration_file setting) to somewhere in the shared directory.

This is covered in the deployment documentation (but was only added about a month ago).

As for the yml settings - you can remove searchd_file_path, as it's been replaced by indices_location in TS v3, and config_file should be configuration_file.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top