Search:

Search all manuals
Search this manual
Manual
Moxi Server 1.7
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
5 Moxi Performance Tuning Standalone Moxi
Chapter Sections
Chapters

5.1. Connection Counts

5.1. Upstream Connections
5.1. Downstream Connections
5.1. Current Connections

For standalone (client-side) moxi, a key resource to watch is connection usage, especially when bumping into O/S limits (eg, number of file descriptors).

There are two sides of this, client-side (upstream) and membase-side (downstream).

Upstream Connections

In general, moxi usually has no trouble servicing many hundreds or more of connections from upstream clients (eg, from your application). If you need to tune this, use the -c command-line parameter (see moxi -h for more moxi command-line usage information).

However, moxi doesn't let all client/upstream connections attack the servers all at once, but has a (per-thread) connection pool and a configurable concurrency limit on the number of upstream/client requests it will send to downstream servers.

See the "concurrency" (aka, "downstream_max") configuration parameter, as discussed here: Chapter 3, Standalone Moxi Component and Follow A Request Through Moxi

Downstream Connections

The other side of moxi, of course, is with its memcached/membase-facing connections. Usually, you won't run into limitations here, but should instead consider the equation from memcached/membase server's point of view.

You might have NUM_MOXI number of standalone moxi processes all feverishly processing requests at their downstream_max limits of concurrency. And, you might have NUM_MEMBASE number of membase nodes.

So, from each standalone moxi, you'll have these many connections to a single membase node:

NUM_CONN_FROM_MOXI_TO_MEMBASE = NUM_MOXI_WORKER_THREADS x NUM_BUCKETS x downstream_max

To simplify, let's say you just have a single bucket (such as the "default" bucket), that downstream_max is 4 (the default, circa 1.6.0 moxi) and that NUM_MOXI_WORKER_THREADS is 4 (which is also the default -t command-line flag value, circa 1.6.0 moxi). So, in this example, there are 4 x 1 x 4 = 16 connections that a single moxi will make to memcached/membase.

Multiply NUM_CONN_FROM_MOXI_TO_MEMBASE by NUM_MOXI and you'll have the number of connections that each membase will see from the farm of standalone moxi processes. (In your accounting, don't forget to leave some room for other clients (such as membase's own monitoring processes, vbucketmigrator processes and embedded moxi's so that they can create their own connections to membase services).

Multiply NUM_CONN_FROM_MOXI_TO_MEMBASE by NUM_MEMBASE and you'll have the number of connections that each moxi will make just on its downstream side.

These numbers (plus whatever whatever extra wiggle room you need) can help you calculate your ulimit's correctly.

Current Connections

To see the current number of connections into moxi, as totals and on the upstream and/or downstream-side, send moxi an ascii "stats proxy" request. More information on this is at: Chapter 6, Moxi Statistics