← 废纸篓

리눅스 시스템 벤치마크 테스트

历史版本 · 2

윈도우 플랫폼에는 루마스터(유희 마스터)라는 프로그램이 있는데, 데이터가 아주 정확하다고는 할 수 없지만 대략적인 참고 자료로 쓸 수는 있습니다. 물론 다른 전문 벤치마크 소프트웨어도 있고, 리눅스 시스템에서는 특별히 적합한 벤치마크 프로그램을 아직 못 찾았습니다.

Sysbench는 CPU, 메모리, 파일 I/O, 스레드 성능 등을 테스트할 수 있는 다목적 벤치마크 도구입니다. 다양한 성능 테스트 작업을 수행하기 위해 Sysbench를 사용할 수 있습니다.

손에 있는 테스트용 장비가 세 대 있는데, 메커니컬 미니 로컬 호스트, 알리바바 클라우드 개발 클라우드 서버, 화웨이 클라우드 개발 서버가 있습니다

本文目录

Sysbench 설치

대부분의 Linux 배포판에서 패키지 관리 도구를 사용하여 Sysbench를 설치할 수 있습니다. 예를 들어 CentOS 8에서는 다음 명령어를 사용하여 설치할 수 있습니다.

sudo dnf install sysbench

Sysbench 사용 예시

  • CPU 성능 테스트: sysbench --test=cpu run
  • 메모리 읽기 성능 테스트: sysbench --test=memory run
  • 테스트 파일 I/O 성능:
sysbench --test=fileio --file-test-mode=rndrw prepare
sysbench --test=fileio --file-test-mode=rndrw run
sysbench --test=fileio --file-test-mode=rndrw cleanup
  • 멀티 스레드 성능 테스트: sysbench --test=threads --num-threads=4 실행
  • MySQL 데이터베이스 성능 테스트(데이터베이스 최대 연결 수 조정 필요):
sysbench --test=oltp --db-driver=mysql --mysql-db=test --mysql-user=yourusername --mysql-password=yourpassword --oltp-table-size=1000000 prepare
sysbench --test=oltp --db-driver=mysql --mysql-db=test --mysql-user=yourusername --mysql-password=yourpassword --max-time=60 --oltp-read-only=off --oltp-test-mode=complex --max-requests=0 run
sysbench --test=oltp --db-driver=mysql --mysql-db=test --mysql-user=yourusername --mysql-password=yourpassword cleanup

분포 데이터 보고서

ABCD
1
本地机械师阿里云华为云
2
系统配置System Information
Operating System Ubuntu 23.04
Kernel Linux 6.2.0-36-generic x86_64
Model Machenike Machenike DT Computer
Motherboard Machenike Machenike DT Computer
BIOS American Megatrends International, LLC.
DB19V012

CPU Information
Name Intel Core i7-12650H
Topology 1 Processor, 10 Cores, 16 Threads
Identifier GenuineIntel Family 6 Model 154 Stepping 3
Base Frequency 4.60 GHz
L1 Instruction Cache 32.0 KB x 8
L1 Data Cache 48.0 KB x 8
L2 Cache 1.25 MB x 2
L3 Cache 24.0 MB

Memory Information
Size 62.6 GB
System Information
Operating System CentOS Stream 8
Kernel Linux 4.18.0-513.el8.x86_64 x86_64
Model Alibaba Cloud Alibaba Cloud ECS
Motherboard N/A
BIOS SeaBIOS 449e491

CPU Information
Name Intel(R) Xeon(R) Platinum
Topology 1 Processor, 1 Core, 2 Threads
Identifier GenuineIntel Family 6 Model 85 Stepping 4
Base Frequency 2.50 GHz
L1 Instruction Cache 32.0 KB
L1 Data Cache 32.0 KB
L2 Cache 1.00 MB
L3 Cache 33.0 MB

Memory Information
Size 1.65 GB
System Information
Operating System Ubuntu 22.04.1 LTS
Kernel Linux 5.15.0-60-generic x86_64
Model OpenStack Foundation OpenStack Nova
Motherboard N/A
BIOS SeaBIOS
rel-1.10.2-0-g5f4c7b1-20181220_000000-szxrtosci10000

CPU Information
Name Intel(R) Xeon(R) Gold 6278C CPU @ 2.60GHz
Topology 1 Processor, 1 Core, 2 Threads
Identifier GenuineIntel Family 6 Model 85 Stepping 7
Base Frequency 2.60 GHz
L1 Instruction Cache 32.0 KB
L1 Data Cache 32.0 KB
L2 Cache 1.00 MB
L3 Cache 35.8 MB

Memory Information
Size 3.64 GB
3
CPUsysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
events per second: 4032.48

General statistics:
total time: 10.0004s
total number of events: 40330

Latency (ms):
min: 0.25
avg: 0.25
max: 0.73
95th percentile: 0.25
sum: 9997.55

Threads fairness:
events (avg/stddev): 40330.0000/0.00
execution time (avg/stddev): 9.9975/0.00
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
events per second: 1062.51

General statistics:
total time: 10.0008s
total number of events: 10628

Latency (ms):
min: 0.91
avg: 0.94
max: 22.84
95th percentile: 1.06
sum: 9993.46

Threads fairness:
events (avg/stddev): 10628.0000/0.00
execution time (avg/stddev): 9.9935/0.00
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
events per second: 1125.56

General statistics:
total time: 10.0005s
total number of events: 11258

Latency (ms):
min: 0.86
avg: 0.89
max: 1.70
95th percentile: 0.99
sum: 9995.40

Threads fairness:
events (avg/stddev): 11258.0000/0.00
execution time (avg/stddev): 9.9954/0.00
4
内存Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads...

Threads started!

Total operations: 101993199 (10198146.52 per second)

99602.73 MiB transferred (9959.13 MiB/sec)


General statistics:
total time: 10.0001s
total number of events: 101993199

Latency (ms):
min: 0.00
avg: 0.00
max: 0.03
95th percentile: 0.00
sum: 4059.50

Threads fairness:
events (avg/stddev): 101993199.0000/0.00
execution time (avg/stddev): 4.0595/0.00
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads...

Threads started!

Total operations: 48418803 (4841004.79 per second)

47283.99 MiB transferred (4727.54 MiB/sec)


General statistics:
total time: 10.0001s
total number of events: 48418803

Latency (ms):
min: 0.00
avg: 0.00
max: 25.26
95th percentile: 0.00
sum: 4578.95

Threads fairness:
events (avg/stddev): 48418803.0000/0.00
execution time (avg/stddev): 4.5789/0.00
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global

Initializing worker threads...

Threads started!

Total operations: 57056904 (5704765.11 per second)

55719.63 MiB transferred (5571.06 MiB/sec)


General statistics:
total time: 10.0001s
total number of events: 57056904

Latency (ms):
min: 0.00
avg: 0.00
max: 0.06
95th percentile: 0.00
sum: 4556.06

Threads fairness:
events (avg/stddev): 57056904.0000/0.00
execution time (avg/stddev): 4.5561/0.00
5
硬盘2147483648 bytes written in 1.81 seconds (1129.59 MiB/sec).

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 3373.41
writes/s: 2248.94
fsyncs/s: 7201.80

Throughput:
read, MiB/s: 52.71
written, MiB/s: 35.14

General statistics:
total time: 10.0127s
total number of events: 128288

Latency (ms):
min: 0.00
avg: 0.08
max: 5.14
95th percentile: 0.34
sum: 9977.78

Threads fairness:
events (avg/stddev): 128288.0000/0.00
execution time (avg/stddev): 9.9778/0.00
2147483648 bytes written in 19.29 seconds (106.16 MiB/sec).

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 1593.12
writes/s: 1062.08
fsyncs/s: 3406.64

Throughput:
read, MiB/s: 24.89
written, MiB/s: 16.60

General statistics:
total time: 10.0164s
total number of events: 60600

Latency (ms):
min: 0.00
avg: 0.16
max: 31.32
95th percentile: 0.54
sum: 9956.30

Threads fairness:
events (avg/stddev): 60600.0000/0.00
execution time (avg/stddev): 9.9563/0.00
2147483648 bytes written in 18.29 seconds (111.98 MiB/sec).

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
reads/s: 1665.88
writes/s: 1110.59
fsyncs/s: 3563.77

Throughput:
read, MiB/s: 26.03
written, MiB/s: 17.35

General statistics:
total time: 10.0112s
total number of events: 63355

Latency (ms):
min: 0.00
avg: 0.16
max: 205.01
95th percentile: 0.78
sum: 9972.64

Threads fairness:
events (avg/stddev): 63355.0000/0.00
execution time (avg/stddev): 9.9726/0.00
6
多线程Running the test with following options:
Number of threads: 4
Initializing random number generator from current time


Initializing worker threads...

Threads started!


General statistics:
total time: 10.0002s
total number of events: 197956

Latency (ms):
min: 0.16
avg: 0.20
max: 0.34
95th percentile: 0.21
sum: 39970.47

Threads fairness:
events (avg/stddev): 49489.0000/5.70
execution time (avg/stddev): 9.9926/0.00
Running the test with following options:
Number of threads: 4
Initializing random number generator from current time


Initializing worker threads...

Threads started!


General statistics:
total time: 10.0174s
total number of events: 18360

Latency (ms):
min: 0.57
avg: 2.18
max: 32.77
95th percentile: 2.61
sum: 40050.41

Threads fairness:
events (avg/stddev): 4590.0000/94.36
execution time (avg/stddev): 10.0126/0.00
Running the test with following options:
Number of threads: 4
Initializing random number generator from current time


Initializing worker threads...

Threads started!


General statistics:
total time: 10.0004s
total number of events: 28536

Latency (ms):
min: 0.23
avg: 1.40
max: 3.56
95th percentile: 1.47
sum: 39975.16

Threads fairness:
events (avg/stddev): 7134.0000/39.87
execution time (avg/stddev): 9.9938/0.01

사후기

ChatGPT는 여전히 좋은 도구입니다. 위에 있는 표는 이전에 익숙했던 Markdown으로는 완전히 구성할 수 없으며, 표로 만들지 않으면 표시 효과가 매우 좋지 않습니다. 사용자 지정 테마는 페이지 최대 너비를 제한하며, 페이지 설정도 변경하여 너비를 백분율 제한으로 조정했습니다.

  • 간단한 방법은 TablesGenerator와 같은 온라인 도구를 사용하여 HTML 테이블을 생성하는 것입니다(내용이 복잡하면 적합하지 않음)
  • 또는 구글 온라인 문서로 작성한 후 HTML 문서로 다운로드하여 저장하고, 블로그에 바로 복사하는 방법(간단하고 직접적이며, 최종적으로 이 방법을 사용했습니다)

config 설정에서 unsafe 옵션이 활성화되어 있는지 확인하고, 페이지별로 너비를 개별적으로 지정하세요

Hugo에서 페이지별로 너비를 설정할 수 있습니다. 이는 페이지의 프론트 매터에 사용자 지정 파라미터를 추가하여 구현할 수 있습니다. 다음은 예시입니다.

마크다운 페이지의 프론트 매터 부분(일반적으로 파일의 시작 부분)에 사용자 지정 파라미터, 예를 들어 custom_width를 추가하세요

---
title: "我的页面"
date: 2024-01-09
custom_width: "800px"  # 设置宽度为 800 像素
---

正文内容...

귀하의 Hugo 테마에서 해당 단일 페이지 템플릿 파일(예: layouts/_default/single.html)을 찾거나 생성하십시오

단일 페이지 템플릿에서, 페이지의 프론트 매터에 custom_width 파라미터가 있는지 확인하고, 해당 HTML 요소(예: div)에 적용합니다

{{ define "main" }}
  <div style="max-width: {{ with .Params.custom_width }}{{ . }}{{ else }}100%{{ end }}; margin: 0 auto;">
    {{ .Content }}
  </div>
{{ end }}

이 예제에서는 style 속성을 사용하여 div 요소에 max-width 속성을 설정하여 custom_width 매개변수를 지정하지 않을 때 너비를 기본적으로 100%로 만듭니다. margin: 0 auto;는 div 요소를 가운데 정렬하는 데 사용됩니다.

실제 적용 시에는 위 예시를 주제 구조와 CSS 스타일의 세부 사항에 따라 조정해야 할 수 있습니다. 스타일을 조정할 때는 주제의 일관성과 가독성을 유지하는 것이 중요합니다.

활성화된 테마가 약간 달라서 사이트 사용자 정의 CSS 설정을 최종적으로 조정했습니다

目录