Limiting Views Requests

    To limit the number of simultaneous view request on a server node, use the POST /internalSettings HTTP method and URI and a port-related request parameter.


    The settings detailed on this page are meant for performance tuning. Rigorous and careful testing of any changes to these settings should be made in a non-production environment that is representative, in load and scale, of production data before implementing in production. Incorrect settings can cause severe impacts to cluster performance or operation due to resource consumption. Couchbase makes no recommendations for tuning beyond the default settings. Any changes to these settings not explicitly recommended by Couchbase Employees are not supported by Couchbase.

    Couchbase Server provides limits to incoming connections on a server node. The limits are to prevent the server from becoming overwhelmed. When a limit is exceeded, the server rejects the incoming connection, responds with a 503 HTTP status code, and sets the HTTP Retry-After header.

    • If the request is made to a REST port, the response body provides the reason for the rejection.

    • If the request is made on a CAPI port, such as a views request, the server responds with a JSON object with error and reason fields.

    HTTP method and URI

    POST /internalSettings


    The following are port-related request parameters:

    By default, these settings do not have a limit.

    • restRequestLimit

      Maximum number of simultaneous connections each server node accepts on a REST port. Diagnostic-related requests and /internalSettings requests are not counted in this limit.

    • capiRequestLimit

      Maximum number of simultaneous connections each server node accepts on a CAPI port. This port is used for XDCR and views connections.

    • dropRequestMemoryThresholdMiB

      Value in MB. The maximum amount of memory that is used by Erlang VM. If the amount is exceeded, the server starts dropping incoming connections.

    Keep the default setting unless you experience issues with too many requests impacting a node. If these thresholds are set too low, too many requests are rejected by the server, including requests from the Couchbase web console.


    Curl request syntax:

    curl -X POST -u [admin]:[password]
      -d capiRequestLimit=[value]


    Curl request example:

    The following example limits the number of simultaneous views requests and internal XDCR requests which can be made on a port.

    curl -X POST -u Administrator:password \ \
      -d 'capiRequestLimit=50' \
      -d 'restRequestLimit=50'


    No response is returned with a curl request changing the rest or capi request limit. Retrieve the internal settings to see changes.

    The following example retrieves and shows the internal settings with the rest and capi request limits set to 50:

    curl -u Administrator:password
        "capiRequestLimit": 50,
        "dropRequestMemoryThresholdMiB": "",
        "indexAwareRebalanceDisabled": false,
        "maxBucketCount": 30,
        "maxParallelIndexers": 6,
        "maxParallelReplicaIndexers": 2,
        "rebalanceIgnoreViewCompactions": false,
        "rebalanceIndexPausingDisabled": false,
        "rebalanceIndexWaitingDisabled": false,
        "rebalanceMovesBeforeCompaction": 64,
        "rebalanceMovesPerNode": 1,
        "restRequestLimit": 50,
        "xdcrAnticipatoryDelay": 0,
        "xdcrCheckpointInterval": 1800,
        "xdcrDocBatchSizeKb": 2048,
        "xdcrFailureRestartInterval": 30,
        "xdcrMaxConcurrentReps": 32,
        "xdcrOptimisticReplicationThreshold": 256,
        "xdcrWorkerBatchSize": 500