Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Benchttp, a stress testing tool

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Xiaobian today brings you to understand how to use the stress test tool Benchttp. The knowledge points introduced in this article are very detailed. Friends who feel helpful can browse the content of the article together with Xiaobian, hoping to help more friends who want to solve this problem find the answer to the question. Let's learn more about "how to use Benchttp, a stress test tool" together with Xiaobian.

If your primary concern is QPS requests per second, Benchttp is perfect for you.

Benchttp is a super lightweight stress testing tool, simple to install, similar to Apache ab usage, simple test results

example

Initiate 100 requests, simulate 20 concurrency

benchttp -n 100 -c 20 http://localhost:8080

Requests: 100 (1.6/s) is the number of requests processed per second

Duration: 62.391s indicates how many seconds it took to execute all requests. The data in Requests indicates that 100 requests were executed, and 1.6 requests were processed per second. Duration is 100/1.6.

The result information is clear at a glance

common parameters

-n Total number of requests to be initiated

-c Maximum number of concurrent requests

-d How many seconds does the test last

-H custom header,"key: value"

installation method

Use Go to install

go get -u github.com/siadat/benchttp

If there is no go environment, install go first, for example under centos.

yum install go

Then set GOPATH

vi /etc/profile

Add at the bottom:

export GOPATH=/root/go

This path can be customized, save exit, make changes take effect

source /etc/profile

You can execute the above installation command. After execution, there will be Benchttp directory under GOPATH path

Thank you for reading, the above is the "stress test tool Benchttp how to use" all the content, learn friends to quickly operate it. I believe that Xiaobian will definitely bring you better quality articles. Thank you for your support of the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report