我要评分
获取效率
正确性
完整性
易理解

Performing Tests

This section focuses on the Istio latency test. The following operations are performed in the virtual Python environment in the tools/perf/benchmark directory.

  1. Enter the virtual Python environment.
    cd tools/perf/benchmark
    pipenv shell
  2. Perform tests.
    • In the pipenv shell, the available Python executable file name may be python3 or python3.xx. In this case, replace python in the following test commands with the corresponding executable file name.
    • The following test commands run only one round according to the requirements of the configuration file. To minimize the impact of data fluctuation, you can run the test commands for multiple times and calculate the average value of the all test results.

    The downloaded test tool contains the benchmark test script runner.py, which is stored in tools/perf/benchmark/runner/runner.py. You can run the test by providing command line parameters or a configuration file. This section uses the configuration file provided by the test tool for testing.

    python runner/runner.py --config_file ./configs/istio/telemetryv2_stats/latency.yaml

    The following figure shows an example of a successful test. The text in the red box indicates that the program is running in the both sidecar mode.

    The following describes the main parameters in the ./configs/istio/telemetryv2_stats/latency.yaml configuration file.

    • conn: Indicates the number of concurrent connections.
    • qps: Indicates the total number of queries per second across all connections.
    • duration: Indicates the duration of each subtest (unit: second). The value must be greater than 92.
    • run_bothsidecar: Indicates whether to run the test in the both sidecar mode. The default value is true.
    • run_serversidecar: Indicates whether to run the test in the server-only sidecar mode. The default value is false. You can change the value to true to enable this mode.
    • run_clientsidecar: Indicates whether to run the test in the client-only sidecar mode. The default value is false. You can change the value to true to enable this mode.
    • run_no_istio: Indicates whether to perform the test in the no-sidecar mode. The default value is false. You can change the value to true to enable this mode.
  3. Export the test result.

    If the test pods are not deleted or rebuilt in multiple rounds of tests, you can export the test results in batches after all tests are complete. However, to avoid data loss, you are advised to export the test result after each round of test.

    1. Enable port forwarding to obtain the result.
      kubectl -n twopods-istio port-forward svc/fortioclient 9076:9076 &
    2. Obtain the test result and output it to the host. You can change the parameter following --csv_output to change the result output path.
      python ./runner/fortio.py http://localhost:9076 --prometheus=$PROMETHEUS_URL --csv StartTime,ActualDuration,Labels,NumThreads,ActualQPS,p50,p90,p99,p999 --csv_output "./istio-result.csv"