Query Service Nodes

A node running the Query Service executes queries for your application needs.

Since the Query Service doesn’t need to persist data to disk, there are very minimal resource requirements for disk space and disk I/O. You only need to consider CPU and memory.

There are a few questions that will help size the cluster:

  1. What types of queries you need to run?

  2. Do you need to run stale=ok or stale=false queries?

  3. Are the queries simple or complex (requiring JOINs, for example)?

  4. What are the throughput and latency requirements for your queries?

Different queries have different resource requirements. A simple query might return results within milliseconds while a complex query may require several seconds.

At Couchbase, we looked at performance data and customer use cases to provide sizing calculations.

Let’s use CPU/Memory utilization for an example for a Query Service. Assume that you have a user profile store, which stores user’s name, email and address. You would like to query based on user’s email address, and you create a secondary index on email. Now you would like to run a query that looks like this:

Select * from bucket where email = "foo@gmail.com"

By default, N1QL uses stale=ok for a consistency model.

To achieve max throughput of this query, we noticed that it utilized 24 cores completely to achieve an 80% latency of 5ms against a bucket of 20M documents.