Apache Geode Native .NET Framework CHANGELOG

Pool Configuration Example and Settings

Connection pools require standard client/server distributed system and cache configuration settings. You must also configure settings for the locator, server, and pool elements.

  • Locator. Host and port where a server locator is listening.
  • Server. Host and port where a server is listening.
  • Pool. Client/server connection pool.

This page shows examples of creating a pool configuration programmatically using C# code, and declaratively using XML.

Programmatic Pool Configuration

This example shows a programmatic pool configuration. For a list of the attributes you can configure, see PoolFactory in the API docs.

      .AddLocator("localhost", 34756)
      .SetFreeConnectionTimeout(new TimeSpan.FromMilliseconds(12345))
      .SetIdleTimeout(new TimeSpan.FromMilliseconds(5555))
      .SetLoadConditioningInterval(new TimeSpan.FromMilliseconds(23456))
      .SetPingInterval(new TimeSpan.FromMilliseconds(12345))
      .SetReadTimeout(new TimeSpan.FromMilliseconds(23456))
      .SetStatisticInterval(new TimeSpan.FromMilliseconds(10123))
      .SetSubscriptionAckInterval(new TimeSpan.FromMilliseconds(567))
      .SetSubscriptionMessageTrackingTimeout(new TimeSpan.FromMilliseconds(900123))

Declarative (File-based) Pool Configuration

This example shows a file-based pool configuration using an XML configuration file. Following the example is a table that describes the XML pool attributes you can configure.

Note: You create an instance of PoolFactory through PoolManager.

<pool free-connection-timeout="12345" idle-timeout="5555"
      max-connections="7" min-connections="3"
      name="test_pool_1" ping-interval="12345"
      read-timeout="23456" retry-attempts="3" server-group="ServerGroup1"
      socket-buffer-size="32768" statistic-interval="10123"
      subscription-ack-interval="567" subscription-enabled="true"
      subscription-redundancy="0" thread-local-connections="true">
   <locator host="localhost" port="34756"/>

Pool Attributes

Attribute Name Description Default

Number of milliseconds (ms) that the client waits for a free connection if max-connections limit is configured and all connections are in use.

10000 ms


Number of milliseconds to wait for a connection to become idle for load balancing

5000 ms


Interval in which the pool checks to see if a connection to a specific server should be moved to a different server to improve the load balance.

300000 ms (5 minutes)


Maximum number of connections that the pool can create. If all connections are in use, an operation requiring a client-to server-connection is blocked until a connection is available or the free-connection-timeout is reached. If set to -1, there is no maximum. The setting must indicate a cap greater than min-connections.


If you use this setting to cap your pool connections, disable the pool attribute pr-single-hop-enabled. Leaving single hop enabled can increase thrashing and lower performance.



Number of connections that must be created initially.



Pool name.


Interval between pinging the server to show the client is alive, set in milliseconds. Pings are only sent when the ping-interval elapses between normal client messages. This must be set lower than the server’s maximum-time-between-pings.

10000 ms


Setting used for single-hop access to partitioned region data in the servers for some data operations. See PartitionResolver. See note in thread-local-connections below.



Number of milliseconds to wait for a response from a server before the connection times out.



Number of times to retry an operation after a time-out or exception for high availability. If set to -1, the pool tries every available server once until it succeeds or has tried all servers.



Server group from which to select connections. If not specified, the global group of all connected servers is used.



Size of the socket buffer, in bytes, on each connection established.



Default frequency, in milliseconds, with which the client statistics are sent to the server. A value of -1 indicates that the statistics are not sent to the server.



Number of milliseconds to wait before sending an acknowledgment to the server about events received from the subscriptions.



Whether to establish a server to client subscription.



Number of milliseconds for which messages sent from a server to a client are tracked. The tracking is done to minimize duplicate events.



Redundancy for servers that contain subscriptions established by the client. A value of -1 causes all available servers in the specified group to be made redundant.



Whether the connections must have affinity to the thread that last used them.


To set this to true, also set pr-single-hop-enabled to false. A true value in pr-single-hop-enabled automatically assigns a false value to thread-local-connections


update-locator-list-interval An integer number of milliseconds defining the interval between locator list updates. If the value is less than or equal to 0, the update will be disabled. 5000