nginx兼容性验证

文章介绍了如何在LoongnixServer上安装Nginx1.16版本,启动服务,并通过浏览器和curl命令验证其运行状态。此外,还使用ApacheBenchmark进行了压力测试,展示了Nginx的高性能特性。
摘要由CSDN通过智能技术生成

Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上nginx的并发能力在同类型的网页服务器中表现较好。

一、安装启动

1.1、查看系统nginx版本

dnf module list nginx

[root@bogon ~]$ dnf module list nginx
上次元数据过期检查:1:51:09 前,执行于 2023年02月23日 星期四 15时25分30秒。
Loongnix server 8.4 - AppStream
Name                                        Stream                                        Profiles                                        Summary                                             
nginx                                       1.14 [d]                                      common [d]                                      nginx webserver                                     
nginx                                       1.16                                          common [d]                                      nginx webserver                                     

提示:[d]默认,[e]已启用,[x]已禁用,[i]已安装

1.2、nginx软件包安装

dnf module install nginx:1.16

1.3、启动nginx服务

systemctl start nginx.service
systemctl status nginx.service

二、测试

2.1、通过浏览器界面进行验证

在这里插入图片描述

2.2、通过curl打印首页信息

[root@bogon ~]$ curl -I 10.130.0.73
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 23 Feb 2023 09:34:16 GMT
Content-Type: text/html
Content-Length: 3952
Last-Modified: Mon, 01 Nov 2021 08:49:34 GMT
Connection: keep-alive
ETag: "617faa1e-f70"
Accept-Ranges: bytes

2.3、Apache Benchmark 压力工具测试

安装ab测试工具包
yum install httpd-tools
-n 指定总访问量,-c 指定并发访问量
ab -n 500000 -c 500 http://localhost:80/

[root@bogon ~]$ ab -n 500000 -c 500 http://localhost:80/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 50000 requests
Completed 100000 requests
Completed 150000 requests
Completed 200000 requests
Completed 250000 requests
Completed 300000 requests
apr_socket_recv: Connection reset by peer (104)
Total of 311300 requests complete
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值