回答
收藏
分享
举报
request_time远大于upstream_response_time,如何排查?
提问于2021-07-05 15:08

浏览 1.2k

在内网环境,发现有些时候web服务响应很慢,经过打印日志,发现存在这样的情况:request_time有10秒左右,而upstream_response_time只有零点几秒的情况,看起来跟后端应用没什么关系,但不知该如何进一步排查,求指教,谢谢!

已修改于2023-03-17 13:52



写下您的回答
发表回答
全部回答(0)

按点赞数排序

按时间排序

提问者
茶客
这家伙很懒还未留下介绍~
0
文章
4
问答
0
粉丝
相关问答

没看明白,描述详细点呢?

点赞 0
浏览 991

我尝试修改STREAM_MODULES为STREAM_FILTER_MODULES,仍然不奏效,查看auto/modules脚本中,并没有stream过滤模块

点赞 0
浏览 639

根据你提供的配置和错误信息,有几个问题可能导致你无法访问多级目录的资源。下面是可能的解决方案:


1. 尝试一:访问/applet/img/user/fitness_logo2.png 提示404的配置:

```

location / {

    root /app/docker/statics/web;

    try_files $uri $uri/ /index.html;

    index index.html index.htm;

}

location /applet {

  root /app/docker/statics;

  index index.html;

}

```

这个配置中,`location /applet` 指定了根目录为 `/app/docker/statics`,而你的资源实际路径是 `/app/docker/statics/applet`。因此,你需要在 `location /applet` 的配置中添加 `/applet` 部分,以便正确地指向资源路径。修改后的配置如下:

```

location / {

    root /app/docker/statics/web;

    try_files $uri $uri/ /index.html;

    index index.html index.htm;

}

location /applet {

  root /app/docker/statics;

  index index.html;

  try_files $uri $uri/ /applet$uri /applet$uri/ =404;

}

```


2. 尝试二:访问/applet/img/user/fitness_logo2.png 提示404的配置:

```

location / {

    root /app/docker/statics/web;

    try_files $uri $uri/ /index.html;

    index index.html index.htm;

}

location /applet {

  alias /app/docker/statics/applet;

}

```

在这个配置中,你使用了 `alias` 指令来映射 `/applet` 到 `/app/docker/statics/applet` 目录。但是,由于你的请求是 `/applet/img/user/fitness_logo2.png`,Nginx 尝试将请求 `/applet/img/user/fitness_logo2.png/` 解析为目录,并在该目录下寻找索引文件,导致出现错误。为了解决这个问题,你可以尝试在 `location /applet` 的配置中使用 `try_files` 指令来显式指定文件的匹配。修改后的配置如下:

```

location / {

    root /app/docker/statics/web;

    try_files $uri $uri/ /index.html;

    index index.html index.htm;

}

location /applet {

  alias /app/docker/statics/applet;

  try_files $uri $uri/ =404;

}

```

点赞 0
浏览 2.3k