I'm having a problem with curl in PHP that I can't figure out. I have a web server (Apache) that talks to a web service over HTTPS on another Apache server. We'll call them "server A" and "server B".
The problem I'm seeing is that server A only makes one connection at a time using curl to server B per browser that's connected to server A. I'm not sure if this is a curl or apache problem. I have seen references in several places to a max connection per server setting of one for a curl client but I can't verify that it exists.
Scenario:
- I load up twenty different pages in three different browsers, each in its own tab/window within that browser. I tried Firefox, Chrome, and Konqueror all at the same time. Firefox had all its per-server connection limits raised significantly through about:config
- All of those pages are hosted on server A and loading was started close to simultaneously
- Each instance of the page on server A talks to server B using curl
- A single call of this type to server B normally takes ~10 seconds
- Only one TCP connection from A->B is open at any one time per browser that is connected to server A (3 total from A->B)
- I verified that multiple connections from the browsers are opened to server A
AFAICT the requests are all serialized. I'm able to verify that multiple connections are open from browsers to server A, but only one https connection is open from A->B per browser connected to A.
Server B can handle many connections simultaneously but for some reason server A won't open multiple connections to server B. I have tried sending "Connection: close" from both servers A and B to see if that would help. It did not.
I have found lots of people talking about making multiple asynchronous connections per script but what I want to do is open multiple connections across different page instances to one external server.
Any ideas on what the problem is or how to fix it?