forked from observing/thor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Started on a small introduction
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Thor | ||
|
||
Thor is WebSocket benchmarking/load generator. There are a lot of benchmarking | ||
tools for HTTP servers. You've got ab, siege, wrk and more. But all these tools | ||
only work plain ol HTTP and have no support for WebSockets and even if they did | ||
they wouldn't be suitable as they would be testing short running HTTP requests | ||
instead of long running HTTP requests with a lot of messaging traffic. Thor | ||
fixes all of this. | ||
|
||
### Dependencies | ||
|
||
Thor requires Node.js to be installed on your system. If you don't have Node.js | ||
installed you can download it from http://nodejs.org or build it from the github | ||
source repository: http://github.com/joyent/node. | ||
|
||
Once you have Node.js installed, you can use bundled package manager `npm` to | ||
install this module: | ||
|
||
``` | ||
npm install -g thor | ||
``` | ||
|
||
The `-g` command flag tells `npm` to install the module globally on your system. | ||
|
||
### Usage | ||
|
||
``` | ||
thor [options] <urls> | ||
``` | ||
|
||
Thor can hit multiple URL's at once, this is useful if you are testing your | ||
reverse proxies, load balancers or just simply multiple applications. The url | ||
that you supply to `thor` should be written in a WebSocket compatible format | ||
using the `ws` or `wss` protocols: | ||
|
||
``` | ||
thor --amount 5000 ws://localhost:8080 wss://localhost:8081 | ||
``` | ||
|
||
The snippet above will open up `5000` connections against the regular | ||
`ws://localhost:8080` and also `5000` connections against the *secured* | ||
`wss://localhost:8081` server. So a total of `10000` connections will be made. | ||
|
||
One thing to keep in mind is that you probably need to bump the amount of file | ||
descriptors on your local machine if you start testing WebSockets. Set the | ||
`ulimit -n` on machine as high as possible. If you do not know how to do this, | ||
Google it. | ||
|
||
#### Options | ||
|
||
``` | ||
Usage: thor [options] ws://localhost | ||
Options: | ||
-h, --help output usage information | ||
-A, --amount <connections> the amount of persistent connections to generate | ||
-C, --concurrent <connections> how many concurrent-connections per second | ||
-M, --messages <messages> messages to be send per connection | ||
-P, --protocol <protocol> WebSocket protocol version | ||
-B, --buffer <size> size of the messages that are send | ||
-W, --workers <cpus> workers to be spawned | ||
-G, --generator <file> custom message generators | ||
-M, --masked send the messaged with a mask | ||
-b, --binary send binary messages instead of utf-8 | ||
-V, --version output the version number | ||
``` |