# Low performance in Aerospike for batchRequests

**URL:** <https://discuss.aerospike.com/t/low-performance-in-aerospike-for-batchrequests/2317>\
**Category:** Tuning\
**Created:** [December 29, 2015, 4:48am UTC](https://discuss.aerospike.com/t/low-performance-in-aerospike-for-batchrequests/2317 "2015-12-29T04:48:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Cukier](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/daniel_cukier/32/428_2.png) [@Daniel\_Cukier](https://discuss.aerospike.com/u/Daniel_Cukier)\
**Post date:** [December 29, 2015, 4:48am UTC](https://discuss.aerospike.com/t/low-performance-in-aerospike-for-batchrequests/2317/1 "2015-12-29T04:48:51Z")

</div>

I have an application that does a lot of batchGets. Here is the code I use:

```
public byte[][] getBatch(byte[][] keys) {
    Key[] aeroKeys = new Key[keys.length];
    for (int i = 0; i < keys.length; i++) {
        aeroKeys[i] = new Key(NAMESPACE, setName, keys[i]);
    }
    Record[] records = aerospike.get(batchPolicy, aeroKeys);
    byte[][] response = new byte[keys.length][];

    for (int i = 0; i < keys.length; i++) {
        if (records[i] != null) {
            response[i] = (byte[]) records[i].getValue(DEFAULT_BIN_NAME);
        }
    }
    return response;
}

```

This code works perfectly and fast when I have a single request. But when I run multiple parallel threads doing batchGets, it is extremely slow. I don’t see much CPU or I/O usage in the monitoring, so I suspect something is waiting, but I don’t know what it is.

I have tried many different configurations, and this is the config I have now (16 cores server):

```
    service-threads 16
    transaction-queues 16
    transaction-threads-per-queue 16
    batch-index-threads 16
    batch-max-buffers-per-queue 1000
    proto-fd-max 15000
    batch-max-requests 2000000

```

Any idea on whats going on?

---

<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:** [December 29, 2015, 9:49pm UTC](https://discuss.aerospike.com/t/low-performance-in-aerospike-for-batchrequests/2317/2 "2015-12-29T21:49:25Z")

</div>

> <https://stackoverflow.com/questions/34504583/low-performance-in-aerospike-for-batchrequests>
