Merge pull request #13 from tbphp/fix-timeout-too-long
Fix timeout too long
This commit is contained in:
@@ -204,7 +204,7 @@ GPT-Load 采用双层配置架构:
|
||||
| 请求超时 | `request_timeout` | 600 | ✅ | 转发请求完整生命周期超时(秒) |
|
||||
| 连接超时 | `connect_timeout` | 15 | ✅ | 与上游服务建立连接超时(秒) |
|
||||
| 空闲连接超时 | `idle_conn_timeout` | 120 | ✅ | HTTP 客户端空闲连接超时(秒) |
|
||||
| 响应头超时 | `response_header_timeout` | 15 | ✅ | 等待上游响应头超时(秒) |
|
||||
| 响应头超时 | `response_header_timeout` | 600 | ✅ | 等待上游响应头超时(秒) |
|
||||
| 最大空闲连接数 | `max_idle_conns` | 100 | ✅ | 连接池最大空闲连接总数 |
|
||||
| 每主机最大空闲连接数 | `max_idle_conns_per_host` | 50 | ✅ | 每个上游主机最大空闲连接数 |
|
||||
|
||||
|
@@ -204,7 +204,7 @@ Dynamic configuration is stored in the database and supports real-time modificat
|
||||
| Request Timeout | `request_timeout` | 600 | ✅ | Forward request complete lifecycle timeout (seconds) |
|
||||
| Connection Timeout | `connect_timeout` | 15 | ✅ | Timeout for establishing connection with upstream service (seconds) |
|
||||
| Idle Connection Timeout | `idle_conn_timeout` | 120 | ✅ | HTTP client idle connection timeout (seconds) |
|
||||
| Response Header Timeout | `response_header_timeout` | 15 | ✅ | Timeout for waiting upstream response headers (seconds) |
|
||||
| Response Header Timeout | `response_header_timeout` | 600 | ✅ | Timeout for waiting upstream response headers (seconds) |
|
||||
| Max Idle Connections | `max_idle_conns` | 100 | ✅ | Connection pool maximum total idle connections |
|
||||
| Max Idle Connections Per Host | `max_idle_conns_per_host` | 50 | ✅ | Maximum idle connections per upstream host |
|
||||
|
||||
|
@@ -188,7 +188,7 @@ func (ps *ProxyServer) executeRequestWithRetry(
|
||||
var parsedError string
|
||||
|
||||
if err != nil {
|
||||
statusCode = 0
|
||||
statusCode = 500
|
||||
errorMessage = err.Error()
|
||||
logrus.Debugf("Request failed (attempt %d/%d) for key %s: %v", retryCount+1, cfg.MaxRetries, utils.MaskAPIKey(apiKey.KeyValue), err)
|
||||
} else {
|
||||
|
@@ -23,10 +23,10 @@ type SystemSettings struct {
|
||||
RequestLogWriteIntervalMinutes int `json:"request_log_write_interval_minutes" default:"5" name:"日志延迟写入周期(分钟)" category:"基础参数" desc:"请求日志从缓存写入数据库的周期(分钟),0为实时写入数据。" validate:"min=0"`
|
||||
|
||||
// 请求设置
|
||||
RequestTimeout int `json:"request_timeout" default:"600" name:"请求超时(秒)" category:"请求设置" desc:"转发请求的完整生命周期超时(秒),包括连接、重试等。" validate:"min=1"`
|
||||
RequestTimeout int `json:"request_timeout" default:"600" name:"请求超时(秒)" category:"请求设置" desc:"转发请求的完整生命周期超时(秒)等。" validate:"min=1"`
|
||||
ConnectTimeout int `json:"connect_timeout" default:"15" name:"连接超时(秒)" category:"请求设置" desc:"与上游服务建立新连接的超时时间(秒)。" validate:"min=1"`
|
||||
IdleConnTimeout int `json:"idle_conn_timeout" default:"120" name:"空闲连接超时(秒)" category:"请求设置" desc:"HTTP 客户端中空闲连接的超时时间(秒)。" validate:"min=1"`
|
||||
ResponseHeaderTimeout int `json:"response_header_timeout" default:"15" name:"响应头超时(秒)" category:"请求设置" desc:"等待上游服务响应头的最长时间(秒),用于流式请求。" validate:"min=1"`
|
||||
ResponseHeaderTimeout int `json:"response_header_timeout" default:"600" name:"响应头超时(秒)" category:"请求设置" desc:"等待上游服务响应头的最长时间(秒)。" validate:"min=1"`
|
||||
MaxIdleConns int `json:"max_idle_conns" default:"100" name:"最大空闲连接数" category:"请求设置" desc:"HTTP 客户端连接池中允许的最大空闲连接总数。" validate:"min=1"`
|
||||
MaxIdleConnsPerHost int `json:"max_idle_conns_per_host" default:"50" name:"每主机最大空闲连接数" category:"请求设置" desc:"HTTP 客户端连接池对每个上游主机允许的最大空闲连接数。" validate:"min=1"`
|
||||
|
||||
|
Reference in New Issue
Block a user