Welcome! Log In Create A New Profile

Advanced

Requesting a Nginx Variable - "client_time_taken" (similar to request_time & upstream_response_time)

Devarajan D via nginx
October 01, 2023 10:52AM
Dear Team,



We're using Nginx 1.22.1 open source version as Load Balancer and tomcat servers as upstream.

We got a complaint from one of our clients stating the request time is too long (~30 minutes for ~10MB uploads) from our server for few MBs of Request Upload.


On checking, we found the requests are reaching the upstream after this said ~30 minutes delay as checked from tomcat logs. (So slowness is not in the tomcat server)



Also, found the request body is buffered to the temporary file (client_body_buffer_size 16K default value is used)



We created a separate location block for this particular client URL path (say. abc.service.com/customer1/) and



We persisted the temporary client body buffer file (using the directive client_body_in_file_only on) and found the ~30 minutes delay matched with the (temp buffer file last modified time - file creation time)



We assume the client is slow on the following basis,

1. Temporary buffer file time as said above
2. Requests of other Clients of similar requests body sizes are served faster in a few seconds.

3. There is no hardware issue in the Nginx server as checked from atopsar and other commands.



Need from Nginx Developers/community:



Currently, there is no straightforward way to measure the time taken by client to upload the request body. 


1. A variable similar to request_time, upstream_response_time can be helpful to easily log this time taken by client.
    So it will be easy to prove to the client where the slowness is.



2. Also, is there a timeout for the whole request?

    (say request should be timed out if it is more than 15 minutes)





Thanks & Regards,

Devarajan D._______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Requesting a Nginx Variable - "client_time_taken" (similar to request_time & upstream_response_time)

Devarajan D via nginx October 01, 2023 10:52AM

Re: Requesting a Nginx Variable - "client_time_taken" (similar to request_time & upstream_response_time)

Maxim Dounin October 01, 2023 06:18PM

Re: Requesting a Nginx Variable - "client_time_taken" (similar to request_time & upstream_response_time)

Devarajan D via nginx October 02, 2023 05:56AM

Re: Requesting a Nginx Variable - "client_time_taken" (similar to request_time & upstream_response_time)

Maxim Dounin October 02, 2023 10:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 238
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready