# How to write using asbench so that write-q go beyond max-write-cache for testing in community edition

**URL:** <https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437>\
**Category:** Operations\
**Created:** [May 13, 2022, 10:39am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437 "2022-05-13T10:39:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karan190](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@Karan190](https://discuss.aerospike.com/u/Karan190)\
**Post date:** [May 13, 2022, 10:39am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/1 "2022-05-13T10:39:43Z")

</div>

I have created a 3 node cluster, monitoring it using python client, so I am not able to figure out, How I can **write** to a node so that it could go beyond **max-write-cache** configured. so that I can test my python script. I want my **write-q** to be increase.

I have two namespaces

1. write-block-size = 128K , max-write-cache =64M
2. write-block-size = 1M, max-write-cache = 64M

I want my **write-q** to be go beyond **512** either in **1st** case or **64** in **2nd** namespace.

I tried to use **aerospike benchmark tool** , but not able to figure out how I can write.

---

<div class="post-metadata">

**Author:** ![neelp](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/neelp/32/1369_2.png) [@neelp](https://discuss.aerospike.com/u/neelp)\
**Post date:** [May 13, 2022, 3:20pm UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/2 "2022-05-13T15:20:21Z")

</div>

What results are you seeing when you run asbench, and what is the namespace and device configuration? One obvious suggestion is to increase the concurrency and percentage of writes. Note also that the device speed and network speed will dictate whether it is possible to create the condition; if the device throughput is higher than the write throughput you are able to generate, you may not be able back up writes to the device.

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [May 13, 2022, 3:35pm UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/3 "2022-05-13T15:35:39Z")

</div>

You could use docker to throttle the device io: [`--device-write-bps=""`](https://docs.docker.com/engine/reference/run/).

---

<div class="post-metadata">

**Author:** ![Karan190](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@Karan190](https://discuss.aerospike.com/u/Karan190)\
**Post date:** [May 13, 2022, 4:21pm UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/4 "2022-05-13T16:21:37Z")

</div>

this is the command i am running

 ![Screenshot 2022-05-13 at 9.37.25 PM](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/8/803d40a0f6f1e2b6b846a6c1f17b1a24ccf6dad7.png)

this is the output i am getting

 ![Screenshot 2022-05-13 at 9.37.43 PM](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/5/502b21645ccfaab3d00519c09c3034bd8dd0fcf0.jpeg)

 ![Screenshot 2022-05-13 at 9.36.58 PM](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/9/95072b604341609121733bfe62d0529aedf609bf.png)

the device config is

 ![Screenshot 2022-05-13 at 9.38.30 PM](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/5/5cb4d1e0999d3aff964309ed6da252a12e8f36fa.jpeg)

the **write-q** is remaining **0** , how to increase it.

---

<div class="post-metadata">

**Author:** ![neelp](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/neelp/32/1369_2.png) [@neelp](https://discuss.aerospike.com/u/neelp)\
**Post date:** [May 14, 2022, 12:01am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/5 "2022-05-14T00:01:52Z")

</div>

Can you please try with “data-in-memory false” for the namespaces?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [May 14, 2022, 1:04am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/6 "2022-05-14T01:04:42Z")

</div>

That could go either way. Disabling `data-in-memory` will increase the read pressure on this device, but would also decrease the peak write rate.

@Karan190Your current asbench setting will generate a maximum (assuming no timeouts) of 8 write blocks (`z` parameter), but realistically 1 given the selected blob size. We could possibly reach the 8 block max by increasing the blob size from 1400B to 128KiB / 2 + 1 (ensuring only one record per 128KiB write block), but this would still fall short of flooding the write-queue.

I’d suggest tweaking the asbench request as follows:

```auto
asbench -h 127.0.0.1 -p 3000 -n test -k 1000000 -o B65537 -w RU,1 -a -W8 -C700

```

- Increased the blob size from 1400 bytes to 65537 to increase the rate at which we fill the 128KiB write blocks.
- The `-a` puts asbenchmark into async mode which is usually easier to overwhelm the queues with.
- The `-W` is the number of eventloops which basically governs the number of threads used in async modes. This should be set to the number of cores, I assumed 8 based on your `-z` selection.
- The `-C` is the maximum number of concurrent async commands. Unsure if this is per eventloop or global, I think it is global. You need this to be more than the number of write-blocks supported by the write-q - otherwise we are unlikely to fill the write-q.

For both `-W` and `-C`, you may need to tune these up and down till you reach the peak throughput (especially since you are running on the same node and therefore the benchmark is competing for the same CPU resources as the server).

I would also recommend testing with the client and server each on separate server or desktop hardware (not a laptop), if possible. If not possible, I wouldn’t expect to extract meaningful results from a laptop, laptop based performance testing is typically unreliable and misleading (thermal throttling, Linux on VM, etc).

[Edits]

- Edit 1:
  - Increased blob size from 1400 to 65537.
  - Increased `-W` from 300 to 700 to exceed the 512 write-blocks supported by the write-q.

---

<div class="post-metadata">

**Author:** ![Karan190](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@Karan190](https://discuss.aerospike.com/u/Karan190)\
**Post date:** [May 16, 2022, 11:48am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/7 "2022-05-16T11:48:34Z")

</div>

Thank you so much @kporter @neelp . I have achieved the desired state for testing. and very well explained @kporter .

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [August 8, 2022, 11:49am UTC](https://discuss.aerospike.com/t/how-to-write-using-asbench-so-that-write-q-go-beyond-max-write-cache-for-testing-in-community-edition/9437/8 "2022-08-08T11:49:04Z")

</div>

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.
