Using single persistent socket to send subrequests

Devashi Tandon devashi.tandon at appsentinels.ai
Wed Dec 29 06:30:11 UTC 2021


Hi,

We have a auth module in our code that sends requests to a server and waits for response to approve the request before proceeding to forward the request to a proxy server.

We use the function ngx_http_post_request to post the subrequest.

As I understand, this function adds the request to a queue which is then processed by ngx_http_run_posted_requests function.

We observe that every single subrequest is sent over a new socket connection. Unfortunately, when we scale to more than 1000 concurrent subrequests, we start seeing socket failures.

Is there a way to specify to this function, to maintain a persistent socket connection with the auth server and reuse the same socket connection for sending multiple subrequests?

Any help is appreciated.

Thanks,
Devashi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20211229/19856c4f/attachment-0001.htm>


More information about the nginx-devel mailing list