Webサーバーに負荷をかけるためにApacheベンチマークと包囲を試しましたが、残念ながら私のVPS CPUは5人の同時ユーザーで100%になります。 wordpressサイトにもキャッシュエンジンを使用しています。
以下の情報と結果によると、私のシステムはもっと多くのユーザーを処理できると思いますか?
私のシステム:
Linux snf-654323 3.2.0-4-AMD64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
Debian GNU/Linux 7 \n \l
MemTotal: 6132080 kB
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : QEMU Virtual CPU version 2.0.0
stepping : 3
microcode : 0x1000065
cpu MHz : 2100.000
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 4
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl pni cx16 x2apic popcnt hyperv isor lahf_lm svm abm sse4a vmmcall
bogomips : 4200.00
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : QEMU Virtual CPU version 2.0.0
stepping : 3
microcode : 0x1000065
cpu MHz : 2100.000
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 4
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl pni cx16 x2apic popcnt hyperv isor lahf_lm svm abm sse4a vmmcall
bogomips : 4200.00
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
Mysqltunerの結果:
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.43-0+deb7u1
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 28B (Tables: 10)
[--] Data in InnoDB tables: 2M (Tables: 35)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 35
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 3h 0m 41s (122K q [11.259 qps], 7K conn, TX: 626M, RX: 13M)
[--] Reads / Writes: 86% / 14%
[--] Total buffers: 192.0M global + 2.7M per thread (151 max threads)
[OK] Maximum possible memory usage: 597.8M (9% of installed RAM)
[OK] Slow queries: 0% (0/122K)
[OK] Highest usage of available connections: 20% (31/151)
[OK] Key buffer size / total MyISAM indexes: 16.0M/125.0K
[OK] Query cache efficiency: 73.5% (65K cached / 89K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 106 sorts)
[OK] Temporary tables created on disk: 25% (120 on disk / 464 total)
[OK] Thread cache hit rate: 98% (89 created / 7K connections)
[OK] Table cache hit rate: 78% (96 open / 123 opened)
[OK] Open file limit used: 6% (68/1K)
[OK] Table locks acquired immediately: 100% (9K immediate / 9K locks)
[OK] InnoDB data size / buffer pool: 2.1M/128.0M
SIEGEの結果:
root@snf-654323:~# siege -c5 -t5M -b http://example.com
** SIEGE 2.70
** Preparing 5 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done. T ransactions: 3456 hits
Availability: 100.00 %
Elapsed time: 299.74 secs
Data transferred: 2.39 MB
Response time: 0.43 secs
Transaction rate: 11.53 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 4.99
Successful transactions: 3456
Failed transactions: 0
Longest transaction: 1.95
Shortest transaction: 0.00
ユーザーの数ではなく、トランザクションの数です。約300秒で3456で、1秒あたり11.52トランザクションに相当し、最長のトランザクションは1.95秒かかります。これはgoodの範囲内にあるようです。 ApacheとMySQLを調整して、より多くのトランザクションを処理できる場合もありますが、忙しい時間帯に通常の方法として1秒あたり8〜10トランザクションに達するまで気にしません。