Node.js Stress Testing

autocannon is a Node.js-based stress testing tool that supports both command line and code-based testing.

npm address www.npmjs.com/package/aut…

As a frontend developer, I chose this. Other tools like ab and webbench also work.




Install autocannon globally
npm i autocannon -g

Command line usage Execute autocannon -c 100 -d 5 -p 1 https://appvxnsma4r5053.pc.xiaoe-tech.com/

Explanation The above command uses 100 connections for 5 seconds to access

 https://appvxnsma4r5053.pc.xiaoe-tech.com/

<div>
    <div>
        <h3 data-id="heading-9">
            Parameter Explanation
        </h3>
        <ul>
            <li>
                <p>
                    <code>-c/--connections NUM</code> Number of concurrent connections, default 10
                </p>
            </li>
            <li>
                <p>
                    <code>-p/--pipelining NUM</code> Number of pipelined requests per connection. Default 1
                </p>
            </li>
            <li>
                <p>
                    <code>-d/--duration SEC</code> Duration in seconds
                </p>
            </li>
            <li>
                <p>
                    <code>-m/--method METHOD</code> Request method, default GET
                </p>
            </li>
            <li>
                <p>
                    <code>-b/--body BODY</code> Request body
                </p>
            </li>
            <li>
                <p>
                    <code>-H/--header</code> Request headers
                </p>
            </li>
        </ul>
    </div>

Other available: JMeter load testing




评论

暂无评论。

登录后可发表评论。