Benchmarking Alibaba Cloud Object Storage Service (OSS) with ab and wrk Tools

As more and more people come to use Alibaba Cloud Object Storage Service (OSS), the question of OSS’ performance has become increasingly common. In our discussion, performance refers to Queries Per Second (QPS) and the latency of each processing request. One can say that testing the performance of OSS is quite a broad topic.

From the user’s perspective, OSS’ performance is related to the type of stress (synchronous or asynchronous), the size of the requested object, and the request method (read or write). From the perspective of the OSS service, performance is related to the server model (disks, NICs, memories, and CPUs), the number of servers, and the network and load of the entire cluster.

In this blog, we will discuss how you can use the ab and wrk tools in a single-server environment and the method to send requests to OSS endpoints. Additionally, we will also see how you can calculate the request QPS and latency on the client’s side.
Let us begin by understanding the tools, which we will be using to calculate OSS’ performance.

How to Use the ab Tool

Apache Benchmark or ab is a tool officially launched by Apache used to test the performance of Apache servers. The tool views the service capacity provided by the installed Apache servers and the number of requests processed per second.

Refer to the following links to download and installing ab.


As OSS buckets require access permissions, and ab does not support OSS signatures, set the buckets to the public-read-write permission for testing.

Assuming that we simulate 10 concurrent requests for a 100 KB object, common parameters are as follows:

Below is an example that should make things more apparent.


Test the performance of OSS in high-concurrency reads/writes to small files.

Requirements: You will need a bucket with public-read-write permission. You can name it public. The ab tool (open-source) should be running in a Linux environment. Alibaba Cloud OSS provides the service endpoint, for example Prepare a file of 5KB, for example, a 5KB txt file.

Testing Process:

Expected Results:

The test normally executes with 0 failed requests and requests per second value, which reflects the per-second processing capability of the client. However, this does not represent the processing capacity of the OSS server.

Important Notes

Results Analysis

$./ab -c 50 -t 60 -n 300000 -k
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,
Benchmarking (be patient)
Completed 30000 requests
Completed 60000 requests
Completed 90000 requests
Completed 120000 requests
Completed 150000 requests
Completed 180000 requests
Completed 210000 requests
Completed 240000 requests
Finished 250137 requests
Server Software: AliyunOSS
Server Hostname:
Server Port: 80
Document Path: /public/5KB.txt
Document Length: 5120 bytes
Concurrency Level: 50 Concurrency level
Time taken for tests: 60.000 seconds Test time
Complete requests: 250137 Total number of complete requests during the test
Failed requests: 0
Write errors: 0
Keep-Alive requests: 248492 Number of keep-alive requests
Total transferred: 1382504896 bytes
HTML transferred: 1280703929 bytes
Requests per second: 4168.94 [#/sec](mean) Number of requests per second
Time per request: 11.993 [ms](mean) Average latency for each request
Time per request: 0.240 [ms](mean, across all concurrent requests)
Transfer rate: 22501.67 [Kbytes/sec] received
Connection Times (ms) Connection request time
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 1 12 7.6 12 87
Waiting: 1 12 7.6 12 87
Total: 1 12 7.6 12 87
Percentage of the requests served within a certain time (ms)
50% 12
66% 15
75% 16
80% 17
90% 20
95% 23
98% 28
99% 37
100% 87 (longest request)

From the test results, we can see that:

How to Use the wrk Tool

The wrk tool is for HTTP benchmark testing. It can be used to generate significant stress.

Refer to the link below to download and install wrk


You can use the wrk tool in combination with Lua scripts for PUT operations.
Precondition &gt: To use wrk, you would require a bucket with the public-read-write permission. You can name it public. The wrk tool runs in a Linux environment. OSS provides the service endpoint, for example, Prepare a file of 5KB, for example, 5KB.txt.


Here, wrk uses Lua script for uploading operations. The content of the Lua script put.lua is as follows:

counter = 0
request = function()
mypath = "5KB.txt";
local file =, "r");
local body = file:read("*a"); -- read all content
wrk.method = "PUT"
wrk.body = body
path = "/public/test-" .. mypath .. "-" .. counter
wrk.headers["X-Counter"] = counter
counter = counter + 1
return wrk.format(nil, path)
done = function(summary, latency, requests)
for _, p in pairs({ 50, 60, 90, 95, 99, 99.999 }) do
n = latency:percentile(p)
io.write(string.format("%g%%, %d ms\n", p, n/1000.0))
Execute Commands
$./wrk -c 50 -d 60 -t 5 -s put.lua
Initiates a PUT request to the endpoint, for the content specified in put.lua on 5 threads with 50 connections enabled and set to run for 60 seconds.

Test Results:

Running input
-c 50 -d 60 -t 5 -s put.lua
Running 1m test @, test input
5 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 16.23ms 9.49ms 159.48ms 96.45%
Req/Sec 635.38 98.38 0.91k 72.63%
189072 requests in 1.00m, 48.73MB read
Requests/sec: 3151.10
Transfer/sec: 831.58KB
50%, 14 ms
60%, 15 ms
90%, 20 ms
95%, 23 ms
99%, 64 ms
99.999%, 159 ms

Result Analysis

From the test results, we can conclude the following:


Execute the Command:

$./wrk -c 50 -d 60 -t 5
Initiate a GET request to the endpoint, with 5 threads and 50 connections enabled. The request is run for 60 seconds.
Note: The 5KB.txt should exist here.

Test Results:

Running input
-c 50 -d 60 -t 5
Running 1m test @, test input
5 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 12.72ms 5.14ms 62.68ms 80.14%
Req/Sec 814.86 145.65 1.36k 69.43%
241990 requests in 1.00m, 1.25GB read
Requests/sec: 4033.14
Transfer/sec: 21.26MB

Result Analysis

The test results revealed the following:


The results mentioned in this blog revealed that the QPS and latency of Alibaba Cloud Object Storage Service (OSS) shown on the client side as measured by the open-source benchmark tools. However, the performance shown on the client side is subject to the influences of various factors, such as the request methods, the local resources (CPU, memory, and network), and the OSS network conditions.


Follow me to keep abreast with the latest technology news, industry insights, and developer trends.