Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-26
3
Medium Priority
?
83 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

Industry Leaders: 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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

722 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