zl程序教程

您现在的位置是:首页 >  工具

当前栏目

nginx的 keepalive_timeout参数是一个请求完成之后还要保持连

Nginx 一个 参数 请求 完成 之后 保持 timeout
2023-09-11 14:20:31 时间

keepalive_timeout参数是一个请求完成之后还要保持连接多久,不是请求时间多久,目的是保持长连接,减少创建连接过程给系统带来的性能损耗,类似于线程池,数据库连接池。

 

[root@web01 ~]# cat /application/nginx/conf/nginx.conf

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include      mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                                  '$status $body_bytes_sent "$http_referer" '
                                  '"$http_user_agent" "$http_x_forwarded_for"';