Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-09-26
3
Medium Priority
?
119 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
ID: 41818800
What is your server's PHP time out limit set to?
0
 
LVL 12

Accepted Solution

by:
William Nettmann earned 0 total points
ID: 41819174
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
ID: 41825239
Found the solution myself, with suggestions from elsewhere.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
While Plesk offers many potential benefits to website administrators, including compatibility with Windows Server and other leading technologies, the company has also been working to differentiate it from other control panels for content management…
The viewer will learn how to dynamically set the form action using jQuery.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

885 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