ubuntu21.10(linux): 安装和使用ab(ApacheBench, Version 2.3)
2023-09-14 08:59:32 时间
一,安装ab:
1,安装
root@lhdpc:~# apt-get install httpd-tools
2,查看安装的路径
root@lhdpc:~# whereis ab ab: /usr/bin/ab /usr/share/man/man1/ab.1.gz
3,查看ab的版本:
root@lhdpc:~# ab -V This is ApacheBench, Version 2.3 <$Revision: 1879490 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,测试效果
例子:10个并发,总数100次访问
liuhongdi@lhdpc:/data/php/admapi/app$ ab -c 10 -n 100 http://192.168.219.6:8000/goods/detail?goodsid=12323 This is ApacheBench, Version 2.3 <$Revision: 1879490 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.219.6 (be patient).....done Server Software: nginx/1.18.0 Server Hostname: 192.168.219.6 Server Port: 8000 Document Path: /goods/detail?goodsid=12323 Document Length: 37 bytes Concurrency Level: 10 Time taken for tests: 0.059 seconds Complete requests: 10 Failed requests: 7 (Connect: 0, Receive: 0, Length: 7, Exceptions: 0) Total transferred: 2276 bytes HTML transferred: 496 bytes Requests per second: 169.79 [#/sec] (mean) Time per request: 58.897 [ms] (mean) Time per request: 5.890 [ms] (mean, across all concurrent requests) Transfer rate: 37.74 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 0.5 1 2 Processing: 12 26 11.0 25 44 Waiting: 11 26 11.2 25 44 Total: 13 27 10.9 26 45 Percentage of the requests served within a certain time (ms) 50% 26 66% 29 75% 37 80% 42 90% 45 95% 45 98% 45 99% 45 100% 45 (longest request)
三,查看linux的版本:
root@lhdpc:~# more /etc/os-release PRETTY_NAME="Ubuntu 21.10" NAME="Ubuntu" VERSION_ID="21.10" VERSION="21.10 (Impish Indri)" VERSION_CODENAME=impish ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=impish
相关文章
- Linux端口配置文件:实现服务器连接的简单步骤(linux端口配置文件)
- Linux 修改启动服务:管理系统安全运行(linux修改启动服务)
- 深入Linux:安装IDLE编程环境(linux安装idle)
- 一步步教你在Linux上安装MySQL(linux怎么安装mysql)
- 系统安装失败虚拟机遭遇Linux系统安装失败!(虚拟机中linux)
- 系统【Sun服务器上安装Linux操作系统】(sun主机安装linux)
- 探索中文环境下的Linux之旅(中文linux)
- 系统刻录u盘,安装Linux系统(u盘刻录linux)
- Linux中安装JDK的步骤(linux上传jdk)
- Linux系统文件的权限管理(linux系统文件的权限)
- 学习马哥Linux,通过百度云轻松享受自由(马哥linux百度云)
- Linux U盘启动:轻松实现操作系统安装(linux的u盘启动)
- IBM安装Linux:开启新的科技之旅(ibm安装linux)
- 掌握ALT键在Linux中的应用技巧(alt键linux)
- 无需安装,打开Linux系统的方法(linux免安装)
- Linux安全:如何实现最大化保障?(linux安全最大化)
- Linux下文件属性管理(文件属性linux)
- 系统完美搭配:在 Linux 系统上安装 XP 系统(linux系统装xp)
- Linux中的包管理器:让您轻松安装应用(包管理器linux)
- Linux Deb包安装指南(linuxdeb文件安装)
- 掌握Linux包管理,解决软件安装难题(linux包管理)
- Linux下的Samba安装配置
- 安卓手机轻松安装 Linux,体验新乐趣!(安卓手机 安装linux)
- 无序安装Linux,简单又高效!(无盘安装linux)
- 探寻Linux系统下MySQL安装路径(linux查看mysql安装路径)
- ?Linux:最多可安装多少主分区?(linux主分区最多)