Solved

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

Posted on 2016-09-26
3
59 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

635 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