SG Collect Info

sgcollect_info is command line utility that provides detailed statistics for a specific Sync Gateway node. This tool must be run on each node individually, not on all simultaneously.

sgcollect_info outputs the following statistics in a zip file:

  1. Logs

  2. Configuration

  3. Expvars (exported variables) that contain important stats

  4. System Level OS stats

  5. Golang profile output (runtime memory and cpu profiling info)

CLI command and parameters

To see the CLI command line parameters, run:

./sgcollect_info --help


Collect Sync Gateway diagnostics and save locally:

./sgcollect_info /tmp/

Collect Sync Gateway diagnostics and upload them to the Couchbase Support AWS S3 bucket:

./sgcollect_info \
  --sync-gateway-config=/path/to/config.json \
  --sync-gateway-executable=/usr/bin/sync_gateway \ \
  --customer=Acme \

REST Endpoint

sgcollect_info can now be run from the Admin REST API as of Sync Gateway 2.1 using the _sgcollect_info endpoint.

Zipfile contents

The tool creates the following log files in the ouput file.

Log file Description


The http access log for sync gateway (i.e which GETs and PUTs it has received and from which IPs)


The http access log for sg_accel (i.e which GETs and PUTs it has received and from which IPs)


The error log (all logging sent to stderr by sg_accel) for the sg_accel process


The error log (all logging sent to stderr by sync_gateway) for the sync_gateway process


The output of http://localhost:4895 for the running sync gateway


The output of http://localhost:4895/db_name for the running sync gateway


The on-disk configuration file used by sync_gateway when it was launched


The on-disk configuration file used by sg_accel when it was launched


The configuration used by sync gateway as it is running (may not match the on-disk config as it can be changed on-the-fly)


The config used by sync gateway for the database specified by db_name


The expvars (global exposed variables - see for the running sync gateway instance)


The command line arguments passed to sgcollect_info for this particular output


OS-level System Stats


Exported Variables (expvars) from Sync Gateway which show runtime stats


Goroutine pprof profile output


Heap pprof profile output


CPU profile pprof profile output


System level logs like /var/log/dmesg on Linux


The Sync Gateway binary executable


The pprof output that collects directly via an http client rather than using go tool, in case Go is not installed

Installing Optional Dependencies

sgcollect_info will be able to collect more information if the following tools are installed:

  • Golang — this should be the same version that Sync Gateway was built with.

Version Go build version





If go is not installed, sgcollect_info will print the following error message, you can ignore this message and there is no need to report it.

Exception during compression: [Error 2] The system cannot find the file specified IMPORTANT:Compression using gozip failed. Falling back to python implementation. Please let us know about this and provide console output.

Sharing Files with Us

The sgcollect_info tool can result in large files. Simply run the command below, replacing <FILE NAME> and <YOUR COMPANY NAME>, to upload a file to our cloud storage on Amazon AWS. Make sure you include the last slash (/) character after the company name.

curl --upload-file FILE NAME<YOUR COMPANY NAME>/
We ship curl with Couchbase Server, on Linux this is located in /opt/couchbase/bin/.