You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/19 06:51:12 UTC

[GitHub] [apisix] zlhgo opened a new issue, #6879: help request: maybe upstream response time is not true

zlhgo opened a new issue, #6879:
URL: https://github.com/apache/apisix/issues/6879

   ### Description
   
   I added `os.execute("sleep " .. 3)` code to the front of _M.http_access_phase() function of the apisix/init.lua file.
   
   then
   ```
   curl flask-demo.dev.apisix.net:9080
   ```
   
   nginx access log output:
   ```
   127.0.0.1 - - [19/Apr/2022:14:34:41 +0800] flask-demo.dev.apisix.net:9080 "GET /headers HTTP/1.1" 200 20 request_time=3.005 "-" "curl/7.64.0" 127.0.0.1:8102 200 upstream_response_time=3.004 "http://flask-demo.dev.apisix.net:9080"
   ```
   
   file-logger plugin output:
   ```json
   {
       "response": {
           "status": 200,
           "headers": {
               "date": "Tue, 19 Apr 2022 06:24:31 GMT",
               "server": "APISIX/2.11.0",
               "x-request-id": "34305f201c9e8bf97a071726c5f9bf71",
               "content-length": "9",
               "content-type": "application/octet-stream",
               "connection": "close"
           },
           "size": 219
       },
       "service_id": "",
       "server": {
           "hostname": "zlh-PC",
           "version": "2.11.0"
       },
       "latency": 3005.0001144409,
       "request": {
           "headers": {
               "host": "flask-demo.dev.apisix.net:9080",
               "user-agent": "curl/7.64.0",
               "accept": "*/*"
           },
           "url": "http://flask-demo.dev.apisix.net:9080/headers",
           "method": "GET",
           "querystring": {},
           "size": 105,
           "uri": "/headers"
       },
       "client_ip": "127.0.0.1",
       "upstream": "127.0.0.1:8101",
       "route_id": "379684400087963039",
       "upstream_latency": 3004,
       "apisix_latency": 1.000114440918,
       "start_time": 1650349468195
   }
   ```
   
   Perhaps the 3 seconds consumed by the sleep function and the other lua code execution time should not be counted in the upstream response time.
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zlhgo closed issue #6879: help request: maybe upstream response time is not true

Posted by "zlhgo (via GitHub)" <gi...@apache.org>.
zlhgo closed issue #6879: help request: maybe upstream response time is not true
URL: https://github.com/apache/apisix/issues/6879


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102697790

   > 因为我们发现有一些请求在jaeger里后端处理时间只有400ms,但是整个请求有3秒,不过通过nginx日志查看,upstream response time也是3秒,和jaeger数据对不上。
   
   You just need to describe the thing itself, I would like to know inaccurate information about jaeger time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tokers commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102341432

   Strange, the upstream response time uses the "u->start_time" and the current time when the upstream request finalizing, and the start time is later than the access phase.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] github-actions[bot] commented on issue #6879: help request: maybe upstream response time is not true

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1497234842

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102497160

   about `$upstream_response_time`: https://github.com/apache/apisix/issues/5146#issuecomment-928919399


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102487475

   > I added `os.execute("sleep " .. 3)` code to the front of _M.http_access_phase() function of the apisix/init.lua file.
   
   can you show how to hook this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zlhgo commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
zlhgo commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102515745

   @tzssangglass 我还是用中文哈。估计不是同一个问题, #5146 里只是说upstream response time只是比request_time 大一点点。但是我这个测试的sleep 3秒时间也算在了upstream response time了。我只是为了测试我怀疑的一个问题才加了sleep哈,并不是我乱搞事。因为我们发现有一些请求在jaeger里后端处理时间只有400ms,但是整个请求有3秒,不过通过nginx日志查看,upstream response time也是3秒,和jaeger数据对不上。所以才有了这个测试。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #6879: help request: maybe upstream response time is not true

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6879:
URL: https://github.com/apache/apisix/issues/6879#issuecomment-1102665511

   > @tzssangglass 我还是用中文哈。估计不是同一个问题, #5146 里只是说upstream response time只是比request_time 大一点点。但是我这个测试的sleep 3秒时间也算在了upstream response time了。我只是为了测试我怀疑的一个问题才加了sleep哈,并不是我乱搞事。因为我们发现有一些请求在jaeger里后端处理时间只有400ms,但是整个请求有3秒,不过通过nginx日志查看,upstream response time也是3秒,和jaeger数据对不上。所以才有了这个测试。
   
   Don't worry, I know what you're wondering: why sleep is an APISIX behavior (simulating some of APISIX's own latency), but is counted as an upstream latency.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org