一、设置访问的并发量:限制客户端请求的并发量为1个一秒只能接受一个请求;
vim /usr/local/nginx/conf/nginx.conf
里面的/表示:/usr/local/nginx/html
搭建环境
[root@server1 html]# mkdir download
[root@server1 html]# ls
50x.html download index.html
[root@server1t download]# cd
[root@server1 download]# ls
[root@server1 html]# chmod 777 download/gougou.jpg 添加权限
[root@server1 html]# ../sbin/nginx -t 语法检测
[root@server1 html]# ../sbin/nginx -s reload 刷新
二、编辑配置文件,设置burst=5
burst的值是5,最多可以访问5次,并且5次都成功
可以将多余的请求暂时缓存起来
三、设置每秒访问50k
[root@server1 html]# vim /usr/local/nginx/conf/nginx.conf
[root@server1 html]# ../sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@server1 html]# ../sbin/nginx -s reload
nginx服务器有自己默认的日志格式,也可以自定义日志格式
使用另外一台主机访问
[root@localhost ~]# curl 192.168.1.11 编辑完配置文件刷新在后执行此操作