# Unable to Scale Elastic Search Throughput in .Net

**URL:** <https://discuss.elastic.co/t/unable-to-scale-elastic-search-throughput-in-net/116353>\
**Category:** Elasticsearch\
**Created:** [January 20, 2018, 7:34pm UTC](https://discuss.elastic.co/t/unable-to-scale-elastic-search-throughput-in-net/116353 "2018-01-20T19:34:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashwinder\_Singh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Ashwinder\_Singh](https://discuss.elastic.co/u/Ashwinder_Singh)\
**Post date:** [January 20, 2018, 7:34pm UTC](https://discuss.elastic.co/t/unable-to-scale-elastic-search-throughput-in-net/116353/1 "2018-01-20T19:34:07Z")

</div>

I have created a .Net framework 4.5 application, I am trying to increase the overall throughput and response time of my application. Currently i am not able to scale further, despite the powerful hardware. Below are some details.

Currently my application through put is 720 Request/Sec, But same java application is giving me 1050 request/sec.

Elastic Cluster: Three Nodes  
Windows Server: 8 cores 32 GB Ram.

What is weird is that my cpu consumption is under 30%, even under load and even after giving higher Tcp connection, i don't see that many outgoing connection. Below is my code, any suggestion are welcome.

````auto
  private static ElasticLowLevelClient _lowLevel;
var connectionPool = new SniffingConnectionPool(nodes);
            var config = new ConnectionConfiguration(connectionPool)
                .ConnectionLimit(10000)
                .EnableHttpCompression()
                .SniffOnConnectionFault(false)
                .SniffOnStartup(false)
                .EnableTcpKeepAlive(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(2000))
                .DisablePing();
            _lowLevel = new ElasticLowLevelClient(config); />```
````

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [January 22, 2018, 2:03am UTC](https://discuss.elastic.co/t/unable-to-scale-elastic-search-throughput-in-net/116353/2 "2018-01-22T02:03:06Z")

</div>

Please format your code using `</>` in the editor toolbar, or enclose the code block in ```.

> [@Ashwinder\_Singh](#):
>
> .ConnectionLimit(10000)

With such a high connection limit, I suspect the client is not efficiently able to reuse connections. The default connection limit on Windows in the client is set to 80; have you looked at benchmarking how changing the connection limit affects throughput?

> [@Ashwinder\_Singh](#):
>
> .EnableTcpKeepAlive(TimeSpan.FromMilliseconds(200), TimeSpan.FromMilliseconds(2000))

Have you benchmarked how changing these values affects connection reuse and throughput? For

```auto
.EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval)

```

the Windows system defaults are

- `keepAliveTime` is 2 hours
- `keepAliveInterval` is 1 second

[TCPView can be useful for monitoring TCP connections](https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 19, 2018, 2:03am UTC](https://discuss.elastic.co/t/unable-to-scale-elastic-search-throughput-in-net/116353/3 "2018-02-19T02:03:11Z")

</div>

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