Static Connection Pool Slow

Hello all,

I'm using a static connection pool with the .NET NEST client. I have 5 nodes in my cluster and I seed the connection pool with the IPs of the 5 nodes. All works fine when all five nodes are alive. However, if I take 2 nodes offline then the web app can take horribly long depending on which which node is selected for the query.

It seems to me like the pool is still trying to send queries to the offline nodes and is waiting for them them to timeout before moving on to the next node. The timeout takes up to a minute though.

How can the pool move on quicker, or not send requests to offline nodes at all?

        try
        {
            // static connection pool 
            var connectionPool = new StaticConnectionPool(new[] { 
                new Uri("http://192.168.51.1:9200"),
                new Uri("http://192.168.51.2:9200"),
                new Uri("http://192.168.51.3:9200"),
                new Uri("http://192.168.51.4:9200"),
                new Uri("http://192.168.51.5:9200") 
            });
           
            // init connection settings
            var settings = new ConnectionSettings(connectionPool);                
            settings.DefaultIndex("products");

            // return the new API client
            return new ElasticClient(settings);
        }
        catch (Exception ex)
        {
            throw ex;
        }

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