openapi-php-sdk icon indicating copy to clipboard operation
openapi-php-sdk copied to clipboard

Guzzle Pool: Performance degradation under high concurrency

Open francescobianco opened this issue 1 year ago • 2 comments

Labels: performance, investigation, guzzle Context: Bulk API requests using GuzzleHttp\Pool

Description: When sending 100+ requests in parallel through Guzzle's Pool, Openapi SDK instantiates a new Guzzle client per request, defeating connection reuse.

Expected: Reuse HTTP client instance and enable keep_alive option.

Impact: Response latency increases exponentially and API rate-limits are hit sooner.

francescobianco avatar Nov 09 '25 16:11 francescobianco

Hi 👋

This issue should also be resolved (or significantly improved) by the changes introduced in the PR I recently opened for Ticket #6.

✅ What changed

The SDK now allows injecting a custom HTTP client instance into the Client instead of internally creating one for each request.

🎯 Why this helps

Previously, the SDK handled HTTP requests internally (via cURL), which made it impossible to:

reuse connections benefit from persistent clients integrate with tools like Guzzle’s Pool

Now you can pass a single, pre-configured HTTP client instance and reuse it across all requests.

📈 Result
The same HTTP client instance is reused
Connections can be kept alive
Compatible with Guzzle pooling and parallel requests
Avoids creating a new client per request

📈 Result The same HTTP client instance is reused Connections can be kept alive Compatible with Guzzle pooling and parallel requests Avoids creating a new client per request

Seraphim200001 avatar Mar 28 '26 12:03 Seraphim200001

Great work @Seraphim200001, thanks a lot for this! 🙌 We’re currently reviewing it and aiming to merge it soon. I’ll let you know if we need any changes 👍

francescobianco avatar Mar 30 '26 14:03 francescobianco