I have a PHP API (using SLIM) that users different external microservices.
My apache is configured to handle a huge amount of simultaneous connections (without my CURLS I can handle 50k simultaneous connections without any effort). So is my microservice (in Python with GUnicorn - 25 Workers and 25 threads each).
However, I am having a issue when CURLing my Python API with my Apache API. Indeed when I am having high traffic spikes (and therefor a high amount of CURL connections from my PHP to my Python) - my apache starts hanging. It seems as the CURLs are queued. My first thought was that my Python script executes too slowly (500ms). But I then noticed that i could manually launch the Python script without any delay even when it was spiking.
This is why I believe the problem comes from the actual CURLs. Is it possible that they are getting queued when I have too many users Curling at the same time or when the CURL takes too long to respond ?
The consequence of it all is that APACHE takes time to respond and slows down. It even happens that APACHE goes into 503.
FYI : The two APIs are on different DOCKER CONTAINERS but on the same server. Both containers have their SOMAXCON at a high number.
If anyone has any idea, please help.
By CURLs or Curling i mean sending CURL requests to my python api.
I will check mod_wsgi out m, thanks!
Edit : sorry, I meant to send it as a comment