function::qsq_throughput - Linux


Overview

qsq_throughput is a command-line tool for measuring the throughput of a server by sending a stream of queries and measuring the response latency. It is a versatile tool for performance testing and debugging applications, especially web servers.

Syntax

qsq_throughput [options] <url> <request-count> [query]

Options/Flags

  • -H, --host: Specify the hostname or IP address of the server. (Default: localhost)
  • -p, --port: Specify the port number of the server. (Default: 80)
  • -m, --method: Specify the HTTP request method to use. (Default: GET)
  • -t, --threads: Specify the number of concurrent threads to use. (Default: 1)
  • -d, --duration: Specify the duration of the test in seconds. (Default: 10)
  • -q, --query: Specify the query string to append to the URL. (Default: unused)
  • -w, --warmup-time: Specify the warmup time in seconds to run before recording metrics. (Default: 0)
  • -o, --output: Specify the output format (csv, json, or plain). (Default: plain)

Examples

Measure the throughput of a web server using the default settings:

qsq_throughput example.com 100

Measure the throughput with 4 concurrent threads and a duration of 60 seconds:

qsq_throughput -t 4 -d 60 example.com 100

Measure the throughput of a server using HTTPS:

qsq_throughput -H example.com -p 443 -m POST https://example.com 100

Save the results in a CSV file:

qsq_throughput -o csv example.com 1000

Common Issues

  • Connection refused: Ensure that the server is running and listening on the specified port.
  • Timeout errors: Increase the duration or warmup-time if the request is taking longer than expected.
  • Low throughput: Check the server’s resources (e.g., CPU, memory) and make sure it can handle the load.

Integration

qsq_throughput can be integrated into automated testing pipelines with other tools like:

  • JMeter: Can be used to simulate a large number of requests to generate additional load.
  • Grafana: Can be used to visualize the throughput metrics over time for monitoring purposes.

Related Commands

  • curl
  • wrk
  • ab