一篇文章搞定Linux服務(wù)器性能測試工具腳本(評測必備工具整理)

麥子 運(yùn)維技術(shù)667字?jǐn)?shù) 2660閱讀8分52秒閱讀模式

市面上提供云服務(wù)器的服務(wù)商太多太多,那對于我們選擇的服務(wù)器商家的產(chǎn)品如何評測性能呢?總不能都聽一些評測網(wǎng)站的描述。畢竟不同的用戶體驗(yàn)的數(shù)據(jù)和不同地區(qū)用戶,甚至不同的時間選擇的同一個商家的性能也是不同的。最好的方法還是我們自己親身體驗(yàn)進(jìn)行評測。

在這篇文章中,老樂準(zhǔn)備通過整理網(wǎng)上開源的優(yōu)秀的Linux服務(wù)器性能測試腳本,并且親自找一臺服務(wù)器運(yùn)行測試腳本的使用。如果我們以后有服務(wù)器測試的,可以通過這里找到需要的腳本。而且這里的腳本我們也會不定期的更新整理。

1、SuperSpeed 三網(wǎng)測速腳本

bash <(curl -Lso- https://git.io/J1SEh)
## 或者
bash <(curl -Lso- https://raw.githubusercontent.com/sunpma/Speedtest/master/speedtest.sh)

選擇一個安裝方法在服務(wù)器執(zhí)行。

2、檸檬測速腳本

wget -qO- http://ilemonra.in/LemonBenchIntl | bash -s full

來自檸檬測試的腳本,這是完整的腳本,也可以根據(jù)需要分開測試。

# 磁盤測試(快速測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --dtfast

# 磁盤測試(完整測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --dtfull

# 寬帶測試(快速測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --spfast

# 寬帶測試(完整測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --spfull

# Traceroute測試(快速測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --trfast

# Traceroute測試(完整測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --trfull

# CPU基準(zhǔn)測試(快速測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --sbcfast

# CPU基準(zhǔn)測試(完整測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --sbcfull

# 內(nèi)存基準(zhǔn)測試(快速測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --sbmfast

# 內(nèi)存基準(zhǔn)測試(完整測試模式)
bash <(wget -qO- https://ilemonra.in/LemonBenchIntl) --sbmfull

作者來自:https://blog.ilemonrain.com/linux/LemonBench.html

3、跑分性能跑分測試

一般我們看到的服務(wù)器可能內(nèi)存、硬盤、帶寬相差不大,但是CPU的相差也是影響服務(wù)器速度和性能的,這里我們可以通過CPU性能測試腳本。通過跑分測試。

wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh && chmod +x unixbench.sh && ./unixbench.sh
# 或者
wget --no-check-certificate https://cdn.jsdelivr.net/gh/teddysun/across/unixbench.sh && chmod +x unixbench.sh && ./unixbench.sh

或者用這個腳本:

wget --no-check-certificate http://tools.laobuluo.com/tools/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh

跑分時間有點(diǎn)長,需要等待時間比較長。

4、Yet Another Bench Script

這個腳本可以可測試服務(wù)器基本信息、硬盤速度、網(wǎng)絡(luò)帶寬、CPU跑分等。比如FIO硬盤讀寫速度。

curl -sL yabs.sh | bash

5、一鍵媒體兼容測試腳本

bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

通過腳本可以測試服務(wù)器是否兼容流媒體運(yùn)行。

6、服務(wù)器回程線路測試

wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
bash testrace.sh

通過腳本測試國內(nèi)節(jié)點(diǎn)的回程。

7、PING延遲速度測試

PING速度測試,我們可以用本地電腦的PING,或者用在線工具。

https://ping.pe
https://tool.chinaz.com
https://tools.ipip.net/newping.php

這三個都是可以用到的。

同時,在這個工具可以看到節(jié)點(diǎn)的路由去程。

8、路由去程測試腳本

https://tools.ipip.net/traceroute.php

9、綜合腳本測試工具

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

這個腳本比較齊全。這個腳本是來自 https://github.com/BlueSkyXN/SKY-BOX 也是整合來自網(wǎng)上的,功能比較多,需要可選調(diào)用。

比如可以一鍵安裝BBR、包括可以按照SWAP擴(kuò)展。

10、一鍵綜合測試腳本

wget https://raw.githubusercontent.com/oooldking/script/master/superbench.sh
chmod +x superbench.sh
./superbench.sh

總結(jié),這里整理的適合Linux服務(wù)器VPS主機(jī)性能測試的腳本。如果我們有需要測試服務(wù)器的話應(yīng)該是可以用到的。

PS:這些腳本來自網(wǎng)上收集,感謝這些開發(fā)者提供。

投上你的一票
 
  • 本文由 麥子 發(fā)表于 2024年8月9日 08:26:04
  • 轉(zhuǎn)載請務(wù)必保留本文鏈接:http://bjj.org.cn/linux-test-tools.html
  • Linux性能測試
  • 云服務(wù)器測試腳本