Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-thread connection pooling #38

Open
KoteKotlyarov opened this issue Oct 16, 2018 · 0 comments
Open

Multi-thread connection pooling #38

KoteKotlyarov opened this issue Oct 16, 2018 · 0 comments

Comments

@KoteKotlyarov
Copy link

Hi guys. I'm not very familiar with PHP and how it works under the hood. And maybe I should post my question on PHP forums, but let me try ))

I'm here with a question about "connection pool" or "connection manager". I'm investigating is it possible to have something like "connection cache". I have read CURL docs and found that it stores handlers after execution which can be re-use if we're requesting same url+params.

But I don't fully understand is it able to share "connections" between different requests inside single server. If user A opens site1.com which makes request to some api.example.com and then user B opens site2.com (both sites located on my server) which makes same request to the sameapi.example.com. Will the request to site2.com be able to re-use connection from request into site1.com ?

I know it will work like a charm if user opens a page and that page should made dozens of requests. That's fine: just use single curl_init for sync and curl_multi_* for async operations. But it is unclear if it is possible to do the same between different requests into site. Or it will always do the same in all requests: open TCP connection, handshake, ssl validation, etc ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant