Kiểm Tra Tốc Độ Vps Centos Hoặc Linux
Nếu bạn đang sử dụng máy chủ ảo vps, cloud server hoặc dedicated server từ nhà cung cấp dịch vụ nào đó, tất nhiên bạn sẽ muốn có những thông tin chi tiết về chất lượng của vps hoặc server mà bạn đang sử dụng. Thiết kế web chuyên nghiệp EPAL Solution sẽ hướng dẫn bạn cách kiểm tra và đánh giá chất lượng của vps hoặc server centos hoặc linux bằng cách sử dụng nhiều phần mềm hỗ trợ khác nhau.
Để thực hiện được theo bài hướng dẫn này, đầu tiên bạn cần phải có những điều kiện sau :
- Bạn phải có quyền quản trị root trên VPS hoặc Server của mình
- VPS hoặc Server sử dụng hệ điều hành CentOS
- Phần mềm để đăng nhập SSH vào VPS hoặc Server từ máy tính của bạn (mình hay sử dụng PuTTY).
Bây giờ chúng ta sẽ bắt đầu bằng cách đăng nhập bằng tài khoản root vào VPS thông qua PuTTY, sau đó sẽ thực hiện theo những hướng dẫn bên dưới :
KIỂM TRA THÔNG SỐ PHẦN CỨNG CỦA VPS HOẶC SERVER LINUX
KIỂM TRA THÔNG SỐ CPU CỦA VPS HOẶC SERVER
Bạn dùng lệnh “lscpu” để kiểm tra thông tin CPU
lscpu
Ví dụ kết quả:
[root@xtraffic ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 45
Stepping: 7
CPU MHz: 1999.999
BogoMIPS: 3999.99
Virtualization: VT-x
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 4096K
NUMA node0 CPU(s): 0
[root@xtraffic ~]#
Bằng lệnh “lscpu” bạn có thể biết được các thông số cơ bản của CPU như Architecture,CPU(s),Thread(s) per core,CPU MHz,…
KIỂM TRA THÔNG SỐ CỦA NHIỀU ĐƠN VỊ PHẦN CỨNG VPS HOẶC SERVER
Bạn có thể kiểm tra thông số của nhiều đơn vị phần cứng khác nhau như : CPU, RAM, Hard Disk, usb controllers, network adapters,… bằng lệnh “lshw -short”
Trước tiên bạn cần cài đặt lshw trên CentOS bằng lệnh sau:
sudo yum install-y lshw
Sau đó chạy lệnh sau để kiểm tra thông số phần cứng của VPS/Server:
lshw -short
Ví dụ kết quả:
[root@xtraffic ~]# lshw -short
H/W path Device Class Description
=============
system Bochs
/0 bus Motherboard
/0/0 memory 96KiB BIOS
/0/401 processor Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz
/0/1000 memory 512MiB System Memory
/0/1000/0 memory 512MiB DIMM RAM
/0/100 bridge 440FX - 82441FX PMC [Natoma]
/0/100/1 bridge 82371SB PIIX3 ISA [Natoma/Triton II]
/0/100/1.1 storage 82371SB PIIX3 IDE [Natoma/Triton II]
/0/100/1.2 bus 82371SB PIIX3 USB [Natoma/Triton II]
/0/100/1.2/1 usb1 bus UHCI Host Controller
/0/100/1.3 bridge 82371AB/EB/MB PIIX4 ACPI
/0/100/2 display GD 5446
/0/100/3 network Virtio network device
/0/100/4 network Virtio network device
/0/100/5 storage Virtio block device
/0/100/6 generic Virtio memory balloon
/1 eth0 network Ethernet interface
/2 eth1 network Ethernet interface
[root@xtraffic ~]#
KIỂM TRA PHÂN VÙNG Ổ ĐĨA LƯU TRỮ TRÊN VPS HOẶC SERVER
Bạn có thể kiểm tra thông số của ổ đĩa lưu trữ trên VPS hoặc Server của bạn bằng lệnh “lsblk”
lsblk
Ví dụ kết quả:
[root@xtraffic ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 20G 0 disk
└─vda1 252:1 0 20G 0 part /
[root@xtraffic ~]#
KIỂM TRA HIỆU NĂNG (BENCHMARK PERFORMANCE) CỦA VPS HOẶC SERVER
Kiểm tra tốc độ truy xuất của ổ cứng lưu trữ bằng lệnh “dd”
dd là lệnh dùng để kiểm tra tốc độ đọc và ghi (read and write) của ổ cứng lưu trữ bằng cách tạo ra 1 GB dữ liệu ngẫu nhiên. Tốc độ (MB/s) càng cao càng tốt.
ddif=/dev/zeroof=test_pep_vn bs=64k count=16k conv=fdatasync
Ví dụ kết quả:
[root@xtraffic ~]# dd if=/dev/zero of=test_pep_vn bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 4.52049 s, 238 MB/s
[root@xtraffic ~]#
Theo kết quả kiểm tra trên thì tốc độ đọc & ghi của ổ cứng là 238 MB/s. Lưu ý là khi kiểm tra bằng lệnh dd thì một file có tên là “test_pep_vn” sẽ được tạo ra để chứa dữ liệu test, do đó bạn cần xoá file này đi bằng cách dùng lệnh sau ngay khi test xong:
rm-rf ./test_pep_vn
Kiểm tra tốc độ truy xuất của ổ cứng lưu trữ bằng lệnh “ioping”
Lệnh dd ở trên giống như kiểm tra “bandwidth” của ổ cứng thì lệnh ioping sẽ kiểm tra độ trễ của mỗi lần thực hiện lệnh truy xuất của ổ cứng (giống như bạn ping đến địa chỉ ip nào đó).
Đầu tiên bạn cần phải cài đặt ioping bằng lệnh YUM như sau:
yum install-y ioping;
Sau đó kiểm tra ổ cứng bằng lệnh sau:
ioping . -c 20;
Ví dụ:
[root@xtraffic_pep_vn ~]# ioping . -c 20;
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=1 time=367 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=2 time=5.5 ms
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=3 time=4.0 ms
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=4 time=5.5 ms
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=5 time=506 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=6 time=377 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=7 time=474 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=8 time=379 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=9 time=467 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=10 time=388 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=11 time=401 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=12 time=438 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=13 time=457 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=14 time=458 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=15 time=456 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=16 time=472 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=17 time=509 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=18 time=455 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=19 time=443 us
4.0 KiB from . (ext4 /dev/mapper/vg_centos6-lv_root): request=20 time=456 us
--- . (ext4 /dev/mapper/vg_centos6-lv_root) ioping statistics ---
20 requests completed in 19.0 s, 887 iops, 3.5 MiB/s
min/avg/max/mdev = 367 us / 1.1 ms / 5.5 ms / 1.7 ms
Ở kết quả trên, chúng ta quan tâm đến các tham số sau:
- 887 iops : có nghĩa là trong vòng 1 giây ổ cứng có thể thực hiện 887 lần truy vấn (đọc & ghi), con số này càng cao càng tốt
- avg 1.1 ms : tức là độ trễ trung bình (hoặc khoảng thời gian cần thiết để xử lý 1 truy vấn đọc hoặc ghi) của ổ cứng, con số này càng thấp càng tốt.
Kiểm tra hiệu năng toàn diện của VPS hoặc Server bằng sysbench
SYSBENCH LÀ GÌ?
sysbench là phần mềm đánh giá hiệu năng của Server khá tốt và phổ biến. Để sử dụng được sysbench trên VPS của bạn, thì đầu tiên bạn phải cài đặt (nếu chưa có) thông qua lệnh sau:
sudo yum install-y sysbench
KIỂM TRA HIỆU NĂNG CPU CỦA VPS HOẶC SERVER BẰNG SYSBENCH
Sau khi cài đặt thành công sysbench, bạn kiểm tra hiệu năng CPU bằng lệnh sau:
sysbench –test=cpu –cpu-max-prime=20000 run
Ví dụ kết quả kiểm tra gói VPS giá rẻ nhất trên DigitalOcean:
[root@xtraffic ~]# sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 20000
Test execution summary:
total time: 37.7463s
total number of events: 10000
total time taken by event execution: 37.7416
per-request statistics:
min: 3.57ms
avg: 3.77ms
max: 8.80ms
approx. 95 percentile: 3.90ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 37.7416/0.00
[root@xtraffic ~]#
KIỂM TRA HIỆU NĂNG TRUY XUẤT DỮ LIỆU TRÊN Ổ CỨNG CỦA VPS HOẶC SERVER BẰNG SYSBENCH
Để kiểm tra toàn diện hiệu năng truy xuất dữ liệu ổ cứng của VPS hoặc Server bằng sysbench thì chúng ta sẽ sử dụng các lệnh sau :
Chuẩn bị file test
sysbench –test=fileio –file-total-size=5G prepare
Thực hiện test
sysbench –test=fileio –file-total-size=5G –file-test-mode=rndrw –init-rng=on –max-time=300 –max-requests=0 run
Xoá file test sau khi thực hiện test
sysbench –test=fileio –file-total-size=5G cleanup
Ví dụ kết quả như sau:
[root@xtraffic ~]# sysbench --test=fileio --file-total-size=5G prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 40960Kb each, 5120Mb total
Creating files for the test...
[root@xtraffic ~]# sysbench --test=fileio --file-total-size=5G --file-test-mode= rndrw --init-rng=on --max-time=300 --max-requests=0 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from timer.
Extra file open flags: 0
128 files, 40Mb each
5Gb total file size
Block size 16Kb
Number of random requests for random IO: 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
Threads started!
Time limit exceeded, exiting...
Done.
Operations performed: 307200 Read, 204800 Write, 655284 Other = 1167284 Total
Read 4.6875Gb Written 3.125Gb Total transferred 7.8125Gb (26.667Mb/sec)
1706.66 Requests/sec executed
Test execution summary:
total time: 300.0003s
total number of events: 512000
total time taken by event execution: 172.9468
per-request statistics:
min: 0.00ms
avg: 0.34ms
max: 82.05ms
approx. 95 percentile: 0.78ms
Threads fairness:
events (avg/stddev): 512000.0000/0.00
execution time (avg/stddev): 172.9468/0.00
[root@xtraffic ~]# sysbench --test=fileio --file-total-size=5G cleanup
sysbench 0.4.12: multi-threaded system evaluation benchmark
Removing test files...
[root@xtraffic ~]#
KIỂM TRA HIỆU NĂNG MYSQL TRÊN VPS HOẶC SERVER BẰNG SYSBENCH
sysbench cũng cung cấp cho ta cách kiểm tra hiệu năng của MySQL khi chạy trên VPS. Tất nhiên để thực hiện được điều này, thì bạn cần phải cài đặt MySQL trên VPS của mình.
Đầu tiên, bạn cần tạo 1 database để test (ở đây mình tạo database có tên là “pep_test”), sau đó bạn chạy lệnh sau :
Chuẩn bị data để test
sysbench –test=oltp –oltp-table-size=1000000 –db-driver=mysql –mysql-db=pep_test –mysql-user=root –mysql-password=YOUR_MYSQL_ROOT_PASSWORD prepare
Thực hiện test
sysbench –test=oltp –oltp-table-size=1000000 –db-driver=mysql –mysql-db=pep_test –mysql-user=root –mysql-password=YOUR_MYSQL_ROOT_PASSWORD –max-time=60 –oltp-read-only=on –max-requests=0 –num-threads=8 run
Dọn sạch dữ liệu test
sysbench –test=oltp –db-driver=mysql –mysql-db=pep_test –mysql-user=root –mysql-password=YOUR_MYSQL_ROOT_PASSWORD cleanup
Ví dụ kết quả:
[root@xtraffic ~]# sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=pep_test --mysql-user=root --mysql-password=YOUR_MYSQL_ROOT_PASSWORD prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest'...
[root@xtraffic ~]# sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=pep_test --mysql-user=root --mysql-password=YOUR_MYSQL_ROOT_PASSWORD --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 8
Doing OLTP test.
Running mixed OLTP test
Doing read-only test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 7 times)
Done.
OLTP test statistics:
queries performed:
read: 207886
write: 0
other: 29698
total: 237584
transactions: 14849 (247.44 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 207886 (3464.14 per sec.)
other operations: 29698 (494.88 per sec.)
Test execution summary:
total time: 60.0108s
total number of events: 14849
total time taken by event execution: 479.8818
per-request statistics:
min: 10.72ms
avg: 32.32ms
max: 98.05ms
approx. 95 percentile: 42.74ms
Threads fairness:
events (avg/stddev): 1856.1250/4.20
execution time (avg/stddev): 59.9852/0.01
[root@xtraffic ~]# sysbench --test=oltp --db-driver=mysql --mysql-db=pep_test --mysql-user=root --mysql-password=YOUR_MYSQL_ROOT_PASSWORD cleanup
sysbench 0.4.12: multi-threaded system evaluation benchmark
Dropping table 'sbtest'...
Done.
[root@xtraffic ~]#
KIỂM TRA HIỆU NĂNG PHP BẰNG “PHP BENCHMARK SCRIPT”
Đây là mã PHP do xTraffic.pep.vn phát triển nhằm giúp các bạn kiểm tra tốc độ thực thi của PHP trên host, VPS hoặc server của mình. Điều đặc biệt là đoạn mã này không chỉ chạy được trên VPS hay server, mà còn chạy được trên cả Share Host.
Đầu tiên, bạn cần phải có PHP trên host của bạn (khuyến cáo sử dụng PHP 5 trở lên), sau đó bạn vào link http://bit.ly/php-benchmark-script-by-xtraffic-pep-vn để download mã này về và up lên thư mục web của bạn và chạy file index.php để test tốc độ xử lý PHP của host.
Sau đây là kết quả trên VPS giá rẻ nhất của DigitalOcean :
----------------------------------------------------------------------------------------
| PHP BENCHMARK SCRIPT BY XTRAFFIC.PEP.VN |
| VERSION 1.0.0 |
| DOWNLOAD HERE : https://bit.ly/php-benchmark-script-by-xtraffic-pep-vn |
----------------------------------------------------------------------------------------
Start : 2014-09-18 08:27:29
Server : _@_
PHP version : 5.4.31
Platform : Linux
----------------------------------------------------------------------------------------
FUNCTIONS TESTED
+ xtraffic_test_math : 1.92132998 sec.
+ xtraffic_test_stringmanipulation : 1.63660908 sec.
+ xtraffic_test_hashstring : 1.63129616 sec.
+ xtraffic_test_loops : 1.03605604 sec.
+ xtraffic_test_ifelse : 1.47793007 sec.
----------------------------------------------------------------------------------------
* Total time : 7.70322133 sec.
KIỂM TRA HIỆU NĂNG CỦA VPS HOẶC SERVER BẰNG UNIXBENCH
UnixBench là phần mềm kiểm tra hiệu năng VPS hoặc Server của bạn một cách toàn diện và đơn giản. Để cài đặt và chạy UnixBench, bạn cần thực hiện theo thứ tự các lệnh sau:
sudoyum install-y gcc gcc-c++ makelibXext-devel perl-Time-HiRes
wget -c https://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
tarxvzf UnixBench5.1.3.tgz
cdUnixBench
make
./Run
Kết quả kiểm tra hiệu năng VPS giá rẻ nhất của DigitalOcean bằng UnixBench như sau:
[root@xtraffic UnixBench]# ./Run
make all
make[1]: Entering directory `/root/UnixBench'
Checking distribution of files
./pgms exists
./src exists
./testdir exists
./tmp exists
./results exists
make[1]: Leaving directory `/root/UnixBench'
sh: 3dinfo: command not found
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
Version 5.1.3 Based on the Byte Magazine Unix Benchmark
Multi-CPU version Version 5 revisions by Ian Smith,
Sunnyvale, CA, USA
January 13, 2011 johantheghost at yahoo period com
1 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
1 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
1 x Execl Throughput 1 2 3
1 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
1 x File Copy 256 bufsize 500 maxblocks 1 2 3
1 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
1 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
1 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10
1 x Process Creation 1 2 3
1 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
1 x Shell Scripts (1 concurrent) 1 2 3
1 x Shell Scripts (8 concurrent) 1 2 3
=========
BYTE UNIX Benchmarks (Version 5.1.3)
System: xtraffic.pep.vn: GNU/Linux
OS: GNU/Linux -- 2.6.32-431.1.2.0.1.el6.x86_64 -- #1 SMP Fri Dec 13 13:06:13 UTC 2013
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz (4000.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
10:11:46 up 1 day, 19:20, 1 user, load average: 0.07, 0.02, 0.00; runlevel 3
------------------------------------------------------------------------
Benchmark Run: Wed Jun 25 2014 10:11:46 - 10:39:39
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 24594076.4 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2667.8 MWIPS (9.0 s, 7 samples)
Execl Throughput 3325.0 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 732734.6 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 204643.6 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1597063.2 KBps (30.0 s, 2 samples)
Pipe Throughput 1437863.0 lps (10.0 s, 7 samples)
Pipe-based Context Switching 269559.6 lps (10.0 s, 7 samples)
Process Creation 8865.1 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 3896.9 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 528.3 lpm (60.1 s, 2 samples)
System Call Overhead 1760247.4 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 24594076.4 2107.5
Double-Precision Whetstone 55.0 2667.8 485.0
Execl Throughput 43.0 3325.0 773.2
File Copy 1024 bufsize 2000 maxblocks 3960.0 732734.6 1850.3
File Copy 256 bufsize 500 maxblocks 1655.0 204643.6 1236.5
File Copy 4096 bufsize 8000 maxblocks 5800.0 1597063.2 2753.6
Pipe Throughput 12440.0 1437863.0 1155.8
Pipe-based Context Switching 4000.0 269559.6 673.9
Process Creation 126.0 8865.1 703.6
Shell Scripts (1 concurrent) 42.4 3896.9 919.1
Shell Scripts (8 concurrent) 6.0 528.3 880.6
System Call Overhead 15000.0 1760247.4 1173.5
========
System Benchmarks Index Score 1082.6
[root@xtraffic UnixBench]#
KIỂM TRA HIỆU NĂNG MYSQL CỦA VPS HOẶC SERVER BẰNG MYSQL BENCHMARK
MySQL Benchmark là công cụ kiểm tra hiệu năng MySQL toàn diện do chính MySQL phát triển. Để chạy được công cụ này thì máy chủ của bạn bắt buộc phải cài đặt và chạy MySQL thành công.
Để cài đặt MySQL Benchmark bạn cần chạy lệnh sau:
sudoyum install-y mysql-bench
Sau khi cài đặt thành công, bạn cần tạo database có tên là “test” (nếu chưa có) để MySQL Benchmark thực hiện trên database này.
Bạn chạy lần lượt những lệnh sau để thực hiện kiểm tra :
cd/usr/share/sql-bench/
./run-all-tests–user=root –password=YOUR_MYSQL_ROOT_PASSWORD
Sau đây là kết quả chạy trên VPS giá rẻ nhất 1USD/tháng của EPAL Solution:
[root@ramnode-xtraffic sql-bench]# ./run-all-tests --user=root --password=YOUR_MYSQL_ROOT_PASSWORD
Benchmark DBD suite: 2.15
Date of test: 2014-09-23 4:18:15
Running tests on: Linux 2.6.32-042stab093.4 x86_64
Arguments:
Comments:
Limits from:
Server version: MySQL 5.1.73
Optimization: None
Hardware:
alter-table: Total time: 4 wallclock secs ( 0.02 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.03 CPU)
ATIS: Total time: 10 wallclock secs ( 2.22 usr 0.13 sys + 0.00 cusr 0.00 csys = 2.35 CPU)
big-tables: Total time: 5 wallclock secs ( 1.05 usr 0.20 sys + 0.00 cusr 0.00 csys = 1.25 CPU)
connect: Total time: 48 wallclock secs (16.28 usr 5.59 sys + 0.00 cusr 0.00 csys = 21.87 CPU)
create: Total time: 88 wallclock secs ( 1.93 usr 0.62 sys + 0.00 cusr 0.00 csys = 2.55 CPU)
insert: Total time: 476 wallclock secs (141.18 usr 23.27 sys + 0.00 cusr 0.00 csys = 164.45 CPU)
select: Total time: 144 wallclock secs (13.26 usr 1.56 sys + 0.00 cusr 0.00 csys = 14.82 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time: 4 wallclock secs ( 1.30 usr 0.27 sys + 0.00 cusr 0.00 csys = 1.57 CPU)
All 9 test executed successfully
Totals per operation:
Operation seconds usr sys cpu tests
alter_table_add 1.00 0.00 0.00 0.00 100
alter_table_drop 2.00 0.00 0.00 0.00 91
connect 3.00 1.73 0.33 2.06 10000
connect+select_1_row 4.00 2.08 0.36 2.44 10000
connect+select_simple 4.00 1.94 0.39 2.33 10000
count 2.00 0.01 0.00 0.01 100
count_distinct 4.00 0.08 0.00 0.08 1000
count_distinct_2 7.00 0.07 0.01 0.08 1000
count_distinct_big 58.00 1.76 0.04 1.80 120
count_distinct_group 4.00 0.25 0.01 0.26 1000
count_distinct_group_on_key 7.00 0.08 0.02 0.10 1000
count_distinct_group_on_key_parts 3.00 0.26 0.00 0.26 1000
count_distinct_key_prefix 4.00 0.07 0.01 0.08 1000
count_group_on_key_parts 5.00 0.25 0.01 0.26 1000
count_on_key 50.00 3.16 0.44 3.60 50100
create+drop 14.00 0.53 0.17 0.70 10000
create_MANY_tables 58.00 0.41 0.10 0.51 10000
create_index 1.00 0.00 0.00 0.00 8
create_key+drop 13.00 0.61 0.19 0.80 10000
create_table 0.00 0.00 0.00 0.00 31
delete_all_many_keys 16.00 0.01 0.00 0.01 1
delete_big 0.00 0.00 0.00 0.00 1
delete_big_many_keys 16.00 0.01 0.00 0.01 128
delete_key 0.00 0.19 0.07 0.26 10000
delete_range 2.00 0.00 0.00 0.00 12
drop_index 0.00 0.00 0.00 0.00 8
drop_table 0.00 0.00 0.00 0.00 28
drop_table_when_MANY_tables 1.00 0.18 0.07 0.25 10000
insert 29.00 5.74 2.66 8.40 350768
insert_duplicates 7.00 2.00 0.77 2.77 100000
insert_key 29.00 2.32 0.80 3.12 100000
insert_many_fields 2.00 0.08 0.02 0.10 2000
insert_select_1_key 1.00 0.00 0.00 0.00 1
insert_select_2_keys 1.00 0.01 0.00 0.01 1
min_max 2.00 0.01 0.00 0.01 60
min_max_on_key 11.00 4.70 0.86 5.56 85000
multiple_value_insert 1.00 0.08 0.01 0.09 100000
once_prepared_select 11.00 2.88 0.94 3.82 100000
order_by_big 7.00 5.14 0.07 5.21 10
order_by_big_key 7.00 5.35 0.07 5.42 10
order_by_big_key2 6.00 5.15 0.06 5.21 10
order_by_big_key_desc 6.00 5.34 0.09 5.43 10
order_by_big_key_diff 6.00 5.13 0.07 5.20 10
order_by_big_key_prefix 7.00 5.18 0.05 5.23 10
order_by_key2_diff 1.00 0.48 0.01 0.49 500
order_by_key_prefix 0.00 0.25 0.00 0.25 500
order_by_range 0.00 0.26 0.01 0.27 500
outer_join 6.00 0.00 0.00 0.00 10
outer_join_found 6.00 0.01 0.00 0.01 10
outer_join_not_found 5.00 0.00 0.00 0.00 500
outer_join_on_key 5.00 0.00 0.01 0.01 10
prepared_select 13.00 5.83 0.93 6.76 100000
select_1_row 6.00 1.78 0.71 2.49 100000
select_1_row_cache 7.00 1.66 0.68 2.34 100000
select_2_rows 7.00 1.72 0.84 2.56 100000
select_big 7.00 5.25 0.00 5.25 80
select_big_str 2.00 0.71 0.36 1.07 10000
select_cache 17.00 0.58 0.10 0.68 10000
select_cache2 16.00 0.59 0.10 0.69 10000
select_column+column 7.00 1.75 0.74 2.49 100000
select_diff_key 0.00 0.03 0.01 0.04 500
select_distinct 3.00 0.40 0.01 0.41 800
select_group 9.00 0.34 0.03 0.37 2911
select_group_when_MANY_tables 2.00 0.20 0.09 0.29 10000
select_join 1.00 0.11 0.00 0.11 100
select_key 27.00 11.85 2.34 14.19 200000
select_key2 28.00 11.76 2.35 14.11 200000
select_key2_return_key 27.00 12.68 1.12 13.80 200000
select_key2_return_prim 28.00 11.46 2.47 13.93 200000
select_key_prefix 28.00 11.81 2.42 14.23 200000
select_key_prefix_join 2.00 1.01 0.00 1.01 100
select_key_return_key 25.00 11.42 2.54 13.96 200000
select_many_fields 3.00 0.97 0.18 1.15 2000
select_range 17.00 2.01 0.05 2.06 410
select_range_key2 4.00 1.29 0.14 1.43 25010
select_range_prefix 3.00 1.27 0.16 1.43 25010
select_simple 4.00 1.48 0.58 2.06 100000
select_simple_cache 4.00 1.43 0.60 2.03 100000
select_simple_join 0.00 0.15 0.01 0.16 500
update_big 7.00 0.00 0.00 0.00 10
update_of_key 5.00 0.89 0.38 1.27 50000
update_of_key_big 3.00 0.01 0.00 0.01 501
update_of_primary_key_many_keys 4.00 0.01 0.00 0.01 256
update_with_key 26.00 5.13 2.10 7.23 300000
update_with_key_prefix 9.00 2.75 0.78 3.53 100000
wisc_benchmark 1.00 0.79 0.04 0.83 114
TOTALS 787.00 174.91 31.58 206.49 3425950
[root@ramnode-xtraffic sql-bench]#
KIỂM TRA HIỆU NĂNG CỦA VPS HOẶC SERVER BẰNG VPSBENCH
vpsbench đơn giản chỉ là 1 tập lệnh dùng để xem thông tin và đánh giá hiệu năng của VPS hoặc Server trên hệ điều hành Linux. vpsbench giúp bạn xem thông tin CPU (số nhân và tốc độ), RAM và kiểm tra hiệu năng “I/O”, thời gian nén 1 tập tin 25MB bằng Bzip, tốc độ kết nối internet bằng cách download 1 file 100MB từ host khác…
Để thực hiện vpsbench bạn cần chạy theo thứ tự các lệnh sau:
sudoyum install-y timebzip2
bash<(wget –no-check-certificate -O – https://gist.githubusercontent.com/pep-vn/41a76e38217c0a7ab3ff/raw/)
Kết quả kiểm tra hiệu năng VPS giá rẻ nhất của DigitalOcean bằng vpsbench như sau:
[root@xtraffic ~]# bash <(wget --no-check-certificate -O - https://gist.githubusercontent.com/pep-vn/41a76e38217c0a7ab3ff/raw/) --2014-06-25 10:56:14-- https://gist.githubusercontent.com/pep-vn/41a76e38217c0a7ab3ff/raw/ Resolving raw.github.com... 103.245.222.133 Connecting to raw.github.com |103.245.222.133|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://gist.githubusercontent.com/pep-vn/41a76e38217c0a7ab3ff/raw/ [foll owing] --2014-06-25 10:56:15-- https://gist.githubusercontent.com/pep-vn/41a76e38217c0a7ab3ff/raw/ Resolving raw.githubusercontent.com... 103.245.222.133 Connecting to raw.githubusercontent.com|103.245.222.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 4898 (4.8K) [text/plain] Saving to: “STDOUT” 100%[=================>] 4,898 --.-K/s in 0s
2014-06-25 10:56:15 (79.5 MB/s) - written to stdout [4898/4898]
Benching I/O ... OK
Benching CPU. Bzipping 25MB file ... OK
Benching inbound network. Downloading 100MB file ... OK
Share at https://github.com/mgutz/vpsbench/wiki/VPS-Hosts
_06/25/2014 - VMPLAN - DATACENTER - OS - AUTHOR_
```
CPU model: Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz
Number of cores: 1
CPU frequency: 1999.999 MHz
Total amount of RAM: 490 MB
Total amount of swap: 0 MB
System uptime: 1 day, 20:05,
I/O speed: 192 MB/s
Bzip 25MB: 6.67s
Download 100MB file: 28.3MB/s
```
[root@xtraffic ~]#
KIỂM TRA HIỆU NĂNG CỦA VPS HOẶC SERVER BẰNG FREEVPS BENCH (SOURCE FREEVPS)
freevps bench cũng là 1 tập lệnh gần giống với vpsbench do freevps.us phát triển dùng để xem thông tin và kiểm tra hiệu năng toàn diện của VPS hoặc Server của bạn. Điểm khác biệt giữa vpsbench và freevps bench là freevps bench sẽ kiểm tra tốc độ kết nối internet của VPS toàn diện hơn bằng cách download file ở các server đặt tại nhiều địa điểm khác nhau như USA, Nhật Bản, Hà Lan,…
Để thực hiện freevps bench bạn chỉ cần chạy 1 lệnh bên dưới:
bash<(wget –no-check-certificate -O – https://gist.githubusercontent.com/pep-vn/1a12659c9b0a74dcf4f0/raw/)
Kết quả kiểm tra hiệu năng VPS giá rẻ nhất của DigitalOcean bằng freevps bench như sau:
[root@xtraffic ~]# bash <(wget --no-check-certificate -O - https://gist.githubusercontent.com/pep-vn/1a12659c9b0a74dcf4f0/raw/)
CPU model : Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz
Number of cores : 1
CPU frequency : 1999.999 MHz
Total amount of ram : 490 MB
Total amount of swap : 0 MB
System uptime : 1 day, 20:30,
Download speed from CacheFly: 13.5MB/s
Download speed from Coloat, Atlanta GA: 6.24MB/s
Download speed from Softlayer, Dallas, TX: 10.7MB/s
Download speed from Linode, Tokyo, JP: 9.55MB/s
Download speed from i3d.net, Rotterdam, NL: 6.00MB/s
Download speed from Leaseweb, Haarlem, NL: 2.77MB/s
Download speed from Softlayer, Singapore: 106MB/s
Download speed from Softlayer, Seattle, WA: 12.6MB/s
Download speed from Softlayer, San Jose, CA: 10.3MB/s
Download speed from Softlayer, Washington, DC: 11.0MB/s
I/O speed : 204 MB/s
[root@xtraffic ~]#
KIỂM TRA TỐC ĐỘ KẾT NỐI INTERNET CỦA VPS HOẶC SERVER
Bạn có thể upload 1 file dung lượng lớn (cỡ 100MB) lên VPS hoặc Server rồi dùng trình duyệt để download thử file đó về, đây là cách dễ làm và trung thực nhất. Tuy nhiên, cách làm vừa rồi không toàn diện do bạn không thể test tốc độ download từ vị trí địa lý khác (như Mỹ, Anh, Đức,…), do đó xTraffic.pep.vn sẽ giới thiệu đến bạn cách test tốc độ kết nối internet của VPS hoặc Server một cách toàn diện hơn thông qua “speedtest-cli”
speedtest-cli là gì?
“speedtest-cli” là một chương trình kiểm tra tốc độ kết nối internet được viết bằng ngôn ngữ lập trình Python. Chương trình speedtest-cli hoạt động bằng cách download file từ các máy chủ thuộc hệ thống của speedtest.net
Cài đặt speedtest-cli trên VPS hoặc Server
Để thực hiện được, đầu tiên bạn phải có “wget” trên Server của bạn, nếu bạn chưa có “wget” thì có thể cài đặt thông qua lệnh sau:
sudoyum install-y wget
Bạn cài đặt speedtest-cli lên VPS hoặc Server bằng cách dùng theo thứ tự các lệnh sau:
wget –no-check-certificate https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmoda+rx speedtest_cli.py
sudomvspeedtest_cli.py /usr/local/bin/speedtest-cli
sudochownroot:root /usr/local/bin/speedtest-cli
Sau đó, bạn thực hiện kiểm tra tốc độ kết nối internet của VPS hoặc Server của bạn bằng lệnh đơn giản sau:
speedtest-cli
Khi thực hiện lệnh này, “speedtest-cli” sẽ tìm máy chủ gần nhất (theo vị trí địa lý) của speedtest.net để kiểm tra, và kết quả kiểm tra tốc độ kết nối internet VPS giá rẻ nhất của EPAL Solution như sau:
[root@xtraffic ~]# wget --no-check-certificate https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
--2014-06-22 04:42:40-- https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
Resolving raw.github.com... 103.245.222.133
Connecting to raw.github.com|103.245.222.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py [following]
--2014-06-22 04:42:41-- https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py
Resolving raw.githubusercontent.com... 103.245.222.133
Connecting to raw.githubusercontent.com|103.245.222.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20936 (20K) [text/plain]
Saving to: “speedtest_cli.py”
100%[==============================================================================================================================>] 20,936 --.-K/s in 0s
2014-06-22 04:42:42 (78.1 MB/s) - “speedtest_cli.py” saved [20936/20936]
[root@xtraffic ~]# chmod a+rx speedtest_cli.py
[root@xtraffic ~]# sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli
[root@xtraffic ~]# sudo chown root:root /usr/local/bin/speedtest-cli
[root@xtraffic ~]# speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from DigitalOcean (128.199.173.191)...
Selecting best server based on ping...
Hosted by Telin (Singapore) [6.25 km]: 17.246 ms
Testing download speed........................................
Download: 774.99 Mbits/s
Testing upload speed..................................................
Upload: 188.60 Mbits/s
[root@xtraffic ~]#
Theo như kết quả trên, “speedtest-cli” kết nối với máy chủ của Telin đặt tại Singapore (địa điểm gấn nhất của VPS) và có tốc độ download là 774.99 Mbits/s (tương đương 97 MB/s) và upload là 188.60 Mbits/s (tương đương 23.6 MB/s), một con số ấn tượng nếu so với tốc độ kết nối 100 Mbps (tương đương 12.5 MB/s) trong nước của các nhà cung cấp hosting tại Việt Nam.
Hy vọng sau bài hướng dẫn này, các bạn sẽ biết cách đánh giá toàn diện VPS hoặc Server của các nhà cung cấp khác nhau, qua đó lựa chọn cho mình nhà cung cấp có nhất lượng dịch vụ cao nhất và giá rẻ nhất.
Nguồn: pep.vn