sgload

command module
v0.0.0-...-a137165 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

Build Status GoDoc Coverage Status Go Report Card codebeat badge

Load testing tool for Sync Gateway that allows flexible scenarios. Intended successor to gateload.

How to run

Run Sync Gateway

  1. Install and run Sync Gateway locally with the basic-walrus-bucket.json example config

Run sgload

Go get sgload

$ go get -u -v github.com/couchbaselabs/sgload

Run

$ sgload gateload \
    --createreaders \
    --createwriters \
    --numwriters 10000 \
    --numupdaters 10000 \
    --numreaders 100 \
    --numdocs 1000000 \	
    --numrevsperdoc 5 \
    --batchsize 100 \
    --numchannels 10 \
    --sg-url http://localhost:4984/db/ 

For an explanation of the above command line options, and additional options supported run sgload --help or sgload gateload --help

Architecture

sgload

Notes:

  • The gateload runner spawns for and waits for completion for the following goroutines
    • DocFeeders
    • Writers
    • Updaters
    • Readers
  • There is a DocFeeder goroutine created for every Writer goroutine, and it continually feeds it docs until there are none left
  • Writers write docs to Sync Gateway in batches
  • After a writer writes a doc batch, it pushes these doc id's to a channel which the updaters are listening to
  • Updaters read docs from the channel shared with the writers and look for new doc id's that are ready to be updated, until they have enough docs (total docs / numupdaters)
  • Updaters keep updating docs until they have written the number of revisions specified in the numrevsperdoc command line argument
  • Readers are assigned a subset of the channels (and therefore docs) to pull docs from the changes feed and will continue to pull from the changes feed until all docs are seen.

Design

  1. The docfeeder goroutine spreads the docs among the writers as evenly as possible.
  2. Docs are spread evenly as possible among channels
  3. Can specify existing user credentials or tell the tool to create new users as needed (access to admin port required)
  4. When auto-generating users, the user id's will be unique and not interfere with subsequent runs

Supported scenarios

  • Gatealod (writer + updater + reader) -- this is the primary scenario
  • Writeload -- only do writes
  • Readload -- only do reads

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Run a simulated Sync Gateway that ignores requests
Run a simulated Sync Gateway that ignores requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL