go to bug id or search bugs for
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.
Add a Patch
Add a Pull Request
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.
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?