Nginx + Tomcat Architecture Web Services, users feel very slow response, how to troubleshoot it? You can check Nginx's Access.log the first time. The $request _time field is defined in Log_format, which refers to the time from when the user requests the data to the reply data is sent.
Is it slow in nginx, Tomcat or something?
Log_format also provides a $upstream _response_time field, which is the time to start a connection from Nginx to the back end and then close the connection until the data is accepted.
That is to say:
If the $request _time is not quite the same as $upstream _response_time, it is necessary to locate the slow request of the upstream service Tomcat by means of Btrace (Java application).
If the difference is very large, that is, the $upstream_response_time value is relatively small, you need to look at the Nginx module configuration or Nginx and the client's network whether there is a performance bottleneck.
The above describes the Nginx+tomcat slow response problem localization, including the tomcat,nginx aspects of the content, I hope the PHP tutorial interested in a friend helpful.