Solved

Sphinx Search Fails with Error: "connection unexpectedly closed (timed out?)"

Posted on 2016-09-26
3
23 Views
Last Modified: 2016-10-02
I am a total beginner at this, so please forgive me if this is a dumb question.

I am using the "sphinxapi.php" API to search through about 400,000 WordPress posts.

Some search terms always succeed (e.g. "wheelbarrow" or "employee") but others always
fail (e.g. "worker" or "wood"). All terms are included in the documents.

When the search fails, a PHP error is thrown:

<b>Notice</b>: fwrite(): send of 8192 bytes failed with errno=104 Connection reset by
peer in
<b>/home/caselaw/domains/dev.caselaw.tk/public_html/wp-content/plugins/caselaw/sphinxapi.p
hp</b> on line <b>486</b>

Open in new window


Around line 486 in sphinxapi.php is the following code (starting line 485):

function _Send($handle, $data, $length) {
        if (feof($handle) || fwrite($handle, $data, $length) !== $length) {
            $this->_error = 'connection unexpectedly closed (timed out?)';
            $this->_connerror = true;
            return false;
        }
        return true;
    }

Open in new window


How can I even start finding out what is going on?

My dev site is at http://dev.caselaw.tk/search-page/. I am trying to get simple
searches work first, without using the Courts, Categories and Ratings filters on the form.
0
Comment
Question by:William Nettmann
  • 2
3 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
What is your server's PHP time out limit set to?
0
 
LVL 12

Accepted Solution

by:
William Nettmann earned 0 total points
Comment Utility
Hi Jason,

Thanks for trying to help.

Sorted this last night. It wasn't related to the PHP timeout (600 seconds), it was that the result set was to large - 85,000 documents for "worker".

I have restricted the maximum results per page, and it is golden.
1
 
LVL 12

Author Closing Comment

by:William Nettmann
Comment Utility
Found the solution myself, with suggestions from elsewhere.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now