Skip to content

couchbaselabs/sgload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status GoDoc Coverage Status Go Report Card codebeat badge Join the chat at https://gitter.im/couchbase/mobile

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

About

Load testing tool for Couchbase Sync Gateway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages