ทดสอบประสิทธิภาพของ Webserver ด้วย Autocannon และ DDOS Stress

  • 2 ตอบ
  • 1647 อ่าน
*

อั๋น ทรงวุฒิ

  • Sr. Member
  • ****
  • 326
  • 3
  • แพร่ เวียงโกศัย
    • ดูรายละเอียด
    • songwut.biz
เราทำเว็บสักตัวนึง อยากรู้ว่าโดน Request ได้มากแค่ไหน
สามารถใช้ autocannon ทดสอบได้ครับ

อ้างถึง
https://github.com/mcollina/autocannon



autocannon -c100 -d5 p 10 http://localhost:3000

« แก้ไขครั้งสุดท้าย: 16 กรกฎาคม 2021, 04:09:51 PM โดย อั๋น ทรงวุฒิ »

*

อั๋น ทรงวุฒิ

  • Sr. Member
  • ****
  • 326
  • 3
  • แพร่ เวียงโกศัย
    • ดูรายละเอียด
    • songwut.biz
Re: ทดสอบประสิทธิภาพของ Webserver ด้วย Autocannon และ DDOS Stress
« ตอบกลับ #1 เมื่อ: 16 กรกฎาคม 2021, 04:12:28 PM »
อ้างถึง
https://github.com/mlazarov/ddos-stress

git clone https://github.com/mlazarov/ddos-stress.git

cd ddos-stress

npm install ddos-stress
node server.js

เปิดอีก tab แล้วรัน
node node.js

เข้า Browser localhost:3000/

ใส่ url เลือกสัก 1000req แล้ว start ไปเลย

ให้สังเกตอัตรา success

*

อั๋น ทรงวุฒิ

  • Sr. Member
  • ****
  • 326
  • 3
  • แพร่ เวียงโกศัย
    • ดูรายละเอียด
    • songwut.biz
Re: ทดสอบประสิทธิภาพของ Webserver ด้วย Autocannon และ DDOS Stress
« ตอบกลับ #2 เมื่อ: 04 เมษายน 2022, 12:00:06 PM »
อ้างถึง
https://github.com/wg/wrk

git clone https://github.com/wg/wrk
cd wrk
make
sudo mv wrk /usr/local/bin

wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html

ยิง request 30 วินาที โดยใช้ 12 threads แล้วเช็คสถิติ
This runs a benchmark for 30 seconds, using 12 threads, and keeping 400 HTTP connections open.