cloudflare+nginx 分流反代 grpc 的最佳参数? #1942
Unanswered
CrazyBoyFeng
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在示例中定义了以下 nginx 配置,但我不清楚这样是否适合 cloudflare,所以想再讨论一下:
so_keepalive=on;
这是 cloudflare 推荐的设置。client_header_timeout 52w;
在示例中是全局配置。nginx 默认值 1 小时。在 nginx 前面有 cloudflare 后面同时有 grpc 和 网站的情况下,设置 52 周(1 年)会不会引起溢出?keepalive_timeout 52w;
在示例中是全局配置。nginx 默认值 75 秒。设置 52 周(1 年)会不会引起溢出?下面几个配置在示例中是 grpc 的局部配置:
client_max_body_size 0;
不限制单个请求的数据量。client_body_timeout 52w;
&grpc_read_timeout 52w;
这会不会导致溢出?此外网上还有一些教程建议设置以下参数,这是否是适合 cloudflare 的?
client_body_buffer_size 512k;
也许能提升速度?grpc_buffer_size 521k;
也许能提升速度?send_timeout 2h;
访问源超时默认1分钟,增加至2小时也许能改善慢速网络和大数据传输时的连通率?此外还有一些设置应该设置为默认值:
lingering_close always;
忽略客户端的close
信号。cloudflare 默认值。keepalive_time 2h;
cloudflare 默认值。keepalive_requests 100
cloudflare 默认值。grpc_socket_keepalive on
大部分系统上,此参数被so_keepalive
覆盖。grpc_send_timeout 2h
大部分系统上,此参数被send_timeout
覆盖。Beta Was this translation helpful? Give feedback.
All reactions