Home > Backend Development > PHP Tutorial > nginx+tomcat slow response problem location

nginx+tomcat slow response problem location

WBOY
Release: 2016-07-29 08:53:59
Original
1708 people have browsed it

In the web service based on nginx + tomcat architecture, users feel that the response is very slow. How to troubleshoot? You can check the access.log of nginx at the first time. The $request_time field is defined in log_format, which refers to the time from accepting user request data to sending reply data.

Is it slow due to nginx, tomcat or others?

log_format also provides the $upstream_response_time field, which refers to the time from when nginx establishes a connection to the backend to when it accepts the data and closes the connection.

That is to say:

If $request_time is not much different from $upstream_response_time, you need to use Btrace (Java application) and other means to locate the slow request of the upstream service tomcat.

If there is a big difference between the two, that is, the value of $upstream_response_time is relatively small, you need to check whether there is a performance bottleneck in the nginx module configuration or the network between nginx and the client.

The above introduces the location of the slow response problem of nginx+tomcat, including the content of tomcat and nginx. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template