php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69870 Persistent connection with Keep-Alive
Submitted: 2015-06-18 09:18 UTC Modified: -
Votes:3
Avg. Score:3.7 ± 1.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: andrew dot lebedev at gmail dot com Assigned:
Status: Open Package: solr (PECL)
PHP Version: 5.5.26 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andrew dot lebedev at gmail dot com
New email:
PHP Version: OS:

 

 [2015-06-18 09:18 UTC] andrew dot lebedev at gmail dot com
Description:
------------
Hello!

Whould it be posible to have a persistent connection that would live through many php requests and would support http Keep-Alive.

We are using php-fpm and each worker is doing about 500 php requests before it dies. Each php request make one request to Solr running on the same machine. It would help us a lot if each worker had one persistent connection to Solr with http Keep-Alive doing all Solr requests.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-30 14:10 UTC] omars@php.net
Hello Andrew,

Thank you for your request, Currently each SolrClient instance uses its own curl handle, keep alive is enforced, and it is enabled by default on HTTP/1.1 and 'Keep-Alive: 300' header.

I will create a ticket to modify the hard coded value to make it available as SolrClient configuration option, and refactor existing code.

For the each worker, you can use one client to make use of the persistent connection.
 [2016-08-10 14:52 UTC] dyeldandi at gmail dot com
Hello!

As far as I can see curl handler is destroyed after request ends. Would it be possible to keep curl handler in a current thread and reuse it on the next request so that tcp(http) connection would not be broken and established every time?
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC