Couchbase .NET SDK 2.2.4 now Available!

Today we are releasing version 2.2.4 of the Couchbase .NET SDK! This release is the follow-up to 2.2.2 and includes 2.2.3, which was merged into 2.2.4. The most important feature of this release is a new optional IO model which enables the SDK to perform greater throughput using less system resources (TCP sockets).

In addition, there are several critical bug features and enhancements in this release and suggest that any users of previous versions of the SDK, upgrade to 2.2.4!

IO Multiplexing (MUX)

In today’s Micro Service architectures, larger monolithic service tiers are broken into many smaller more discrete deployments using containers. Since every deployment requires a client instance, their is a multiplier effect on the number of TCP connections opened by each deployed application using the SDK. In general, the multiplier is:

Clients x Cluster Nodes x Buckets x TCP connections = Total Connections

Very quickly, in a large deployment with many services, it’s easy to reach the ceiling on the number of TCP connections that a Cluster can handle efficiently. So, the reducing the number of connections puts less pressure on the cluster  allowing for a healthier cluster capable the processing of more requests.

In the past the SDK has used connection pooling where each thread uses a single TCP socket at one time for Memcached K/V operations (Get, Insert, Remove, etc.). The connection pool limit is capped by the MinSize and MaxSize configuration settings; if MaxSize has been reached, the SDK would wait for a connection to become available or it would return an OperationTimeout response.

In general, the performance here is pretty good as Memcached operations are incredibly fast on the server, with the main bottle-neck being network latency. The latency is compounded by the fact that SDK will wait for an operation to complete before making the connection available to the next thread that is waiting.

In this release we are introducing a new optional IO model, called IO multiplexing (MUX) which allows multiple threads to send and receive simultaneously on the same TCP connection. The benefit’s are improved throughput with less strain on the OS resources and importantly, a reduction on the number of TCP connections between the client and the server.

How to use it:

In order to use MUX, you’ll need to configure your client to use it in your App.Config or Web.Config. For example:

The important part is that within your connectionPool element, you are overriding the default connection with the new MultiplexingIOConnection and in the ioService element, your are swapping the default IO service with the new MultiplexingIOService. Once you have done this, the client will be using the new IO service for all Memcached (K/V) operations.

Caveats

A couple of caveats are in order:

  • SSL is not yet supported for MUX (coming soon)
  • Since MUX uses a single connection per node for Memcached (K/V) operations, many of the connection pool settings no longer apply (for example MinSize and MaxSize).
  • MUX has no effect on Views or N1QL queries

Release Notes for v2.2.4

Bug

  • [NCBC-1031] – Couchbase 2.2.1 Performance Degregation vs 2.1.4 + Durability Bug
  • [NCBC-1038] – If no primary index exists and adhoc is false client will loop until timeout
  • [NCBC-1041] – Unhandled out of memory exception on create index error
  • [NCBC-1046] – Make MemcachedConfigContext use NodesAdapter for comparisons
  • [NCBC-1047] – The logs should just tell us the timeout value.
  • [NCBC-1048] – .NET Hello world example does not work

Improvement

  • [NCBC-1044] – Make ServicePointManager changes non-global
  • [NCBC-1045] – Add support for pluggable IO service implementations
  • [NCBC-1049] – Rename IOStrategy to IOService and other name refactoring
  • [NCBC-1050] – Make connection buffer configurable for pipelined/multiplexed IO

Task

  • [NCBC-1039] – Force QueryClient to use HTTP Auth for N1QL queries
  • [NCBC-1042] – Add support for max_parallelism to N1QL query request

How to get v2.2.4

The SDK is available for download directly, through NuGet, or by cloning and pulling the Github repo:

  • Download the binaries here.
  • The NuGet package can be found here.
  • The Github repo is here.

Author

Posted by Jeff Morris, Senior Software Engineer, Couchbase

Jeff Morris is a Senior Software Engineer at Couchbase. Prior to joining Couchbase, Jeff spent six years at Source Interlink as an Enterprise Web Architect. Jeff is responsible for the development of Couchbase SDKs and how to integrate with N1QL (query language).

Leave a reply