# Async rust client high batch\_get response delay

**URL:** <https://discuss.aerospike.com/t/async-rust-client-high-batch-get-response-delay/11648>\
**Category:** Rust Client\
**Created:** [October 21, 2024, 11:04am UTC](https://discuss.aerospike.com/t/async-rust-client-high-batch-get-response-delay/11648 "2024-10-21T11:04:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Kubrinskiy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/alexey_kubrinskiy/32/2453_2.png) [@Alexey\_Kubrinskiy](https://discuss.aerospike.com/u/Alexey_Kubrinskiy)\
**Post date:** [October 21, 2024, 11:04am UTC](https://discuss.aerospike.com/t/async-rust-client-high-batch-get-response-delay/11648/1 "2024-10-21T11:04:01Z")

</div>

I’m working on porting one of our Python projects to Rust. I use Tokio as an async runtime and the [GitHub - aerospike/aerospike-client-rust at async](https://github.com/aerospike/aerospike-client-rust/tree/async) client library.

The application is a thrift CRUD wrapper around aerospike. At this moment rust app acts as a thrift proxy - forwarding all incoming requests (except one, implemented in rust) to the python app. The implemented one is just a single batch\_get + parsing response.

The issue I found is a high batch\_get p99 response delay - ~300ms compared to the sync python client (26ms).

 ![latency](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/9/91718f555f3cf796e7c47e1b960a81d12dfcd91b.png)

Testing environment: rust and python apps are deployed to EKS, same namespace, same nodes(arm64, 4core). Aerospike Enterprise Edition build 7.1.0.3, 2 nodes in the same EKS. Rust and python apps are talking to the same aerospike cluster.

Test method: I use istio to split incoming traffic in a ratio 10:1 rust:python. I need some traffic going to python to see the difference in response time.

I did try my best to find out the reason for such poor rust performance changing number of connections in the pool, pool per node - no visible effect. I tried to install a tokio-console in the hope of seeing some locks/mutexes waiting - nothing interesting there. I tried to add tracing to the aerospike client and found it spends most of the time in parse\_result method.

Also I have found couple of panic conditions (and hopefully some speed improvements) fixed [here](https://github.com/kubroid/aerospike-client-rust/tree/async).

Lookng for any help/advice. Thanks!

Aerospike support ticket: #00038190

---

<div class="post-metadata">

**Author:** ![Alexey\_Kubrinskiy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/alexey_kubrinskiy/32/2453_2.png) [@Alexey\_Kubrinskiy](https://discuss.aerospike.com/u/Alexey_Kubrinskiy)\
**Post date:** [October 21, 2024, 11:05am UTC](https://discuss.aerospike.com/t/async-rust-client-high-batch-get-response-delay/11648/2 "2024-10-21T11:05:29Z")

</div>

Tracing:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/b/bc12f4df6d4d9ca47778ca7f74d99fe57d3958ca.png)

---

<div class="post-metadata">

**Author:** ![Alexey\_Kubrinskiy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/alexey_kubrinskiy/32/2453_2.png) [@Alexey\_Kubrinskiy](https://discuss.aerospike.com/u/Alexey_Kubrinskiy)\
**Post date:** [October 21, 2024, 11:06am UTC](https://discuss.aerospike.com/t/async-rust-client-high-batch-get-response-delay/11648/3 "2024-10-21T11:06:07Z")

</div>

Server reported delays:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/aerospike/original/2X/3/3b3e9a669b01284b9d0874db275b977315422132.png)
