nginx的upstream timer out
时间: 2023-10-13 13:04:17 浏览: 216
在Nginx中,当上游服务器的响应时间超过了预设的超时时间,就会触发upstream timeout(上游超时)的情况。上游超时可以通过检查upstream模块的源码找到相关的代码来确定。
在源码中,可以找到ngx_http_upstream_process_upstream函数来处理上游请求。在这个函数中,如果接收到了上游超时的信号,则会将upstream_error标记为1,并记录日志信息。然后会调用ngx_connection_error函数来抛出NGX_ETIMEDOUT错误,并终止请求的处理。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [nginx upstream模块详解(处理流程篇一 upstream处理)](https://blog.csdn.net/huzilinitachi/article/details/79552739)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [nginx upstream完整交互源码分析](https://blog.csdn.net/realmardrid/article/details/122301279)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文