load-test

command
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Generate HTTP requests, simulating lots of users. This is not intended to be a general-purpose load generator; it is tightly coupled with its sister program, "app," which is a sample RESTful back-end.

At startup: make one goroutine per simulated user. User goroutines live forever, until the simulation is terminated, either by completing testSecs or by receipt of a SIGINT (e.g. user typing ctl-c).

config.toml includes many tunable parameters. Users can alternate between activity and rest (see the alwaysOn flag). Various interesting combinations of parameters are included in comments. The default set of parameters define a quick test with light load.

Users are created with random usernames and passwords. If they are not in the password table, they are added, so the server can authenticate them. The same random seed is always used, so passwords are the same across multiple runs. This program does not read or write the password table during on-going operation, just at start-up time, to ensure that all its users are in the password table, so the restful back-end can autheticate them.

Note that, if numUsers is large, it could take hours to create the password database, since the server calls bcrypt (intentionally slow) to hash each password.

Jump to

Keyboard shortcuts

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