0
votes

I faced this problem from several days and it happens every week I am unable to understand the problem.

Sphinx automatically lost connection on production server.

ThinkingSphinx::SphinxError Lost connection to MySQL server at 'reading initial communication packet'

I am using

  • thinking-sphinx (3.1.4)
  • Rails 4.2.1
  • ruby 2.0.0

My configuration file thinking_sphinx is -

   development:
     min_infix_len: 1
     bin_path: '/usr/bin'
     searchd_binary_name: 'searchd'
     indexer_binary_name: 'indexer'
     utf8: true
     max_matches: 10000
   staging:
     min_infix_len: 1
     bin_path: ''
     searchd_binary_name: ''
     indexer_binary_name: ''
     max_matches: 10000
   production:
     min_infix_len: 1
     bin_path: ''
     searchd_binary_name: ''
     indexer_binary_name: ''
     max_matches: 10000
1

1 Answers

0
votes

I got this kind of issue and resolved with 'reconnect: true' in database.yml not sure if this will solve this issue, but once you will set this option it is not transection safe so if working please do few research with this.

 in database.yml

 reconnect: true