Persistent HTTP Connections

sukhoi35
sukhoi35 used Ask the Experts™
on
Hello Experts,
I have built few HTTP 1.1 listen service mocks using SoapUI and CA DevTest tools. Every request to the service from a client like Postman is established as a new connection. Inserting a custom header Connection:Keep-Alive into the request and also the response is not making any difference. Can I know is there more to be done to have the socket open for successive connections happening within a second?

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
You're basically asking, "How do I provide the entire Apache infrastructure to support Keep Alive connections."

Wow... This is a massive amount of code + many, many, years of dev work...

Tips for getting this working quickly.

1) Use Apache.

2) Get your service running with HTTPS + HTTP2 first, with no payloads.

3) Implement your service using FPM PHP + Opcache correctly tuned + well tooled service caching system. This will provide a service running around 1,000,000 reqs/minute on garden variety hardware... Say OVH hardware in the $100/month USD range...

Note: If you must write code like you've described from scratch, you'll start with the Apache2 source related to HTTPS, HTTP2, Keep Alive... then settle in for many years of dev work to get your code to run with the rock solid stability of Apache.

Author

Commented:
Wow! It is really impressive what happens behind the scenes and the vast amount of implementation that lie underneath. I somehow assumed OS played a major role in keeping the connections alive and can be enabled at the OS level. Thanks David for the detailed information.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You're welcome!

And, Apache handles all the details of Keep Alive processing.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial