@@ -10,7 +10,9 @@ Learn more about [Coder’s architecture](../about/architecture.md) and our
10
10
## Recent scale tests
11
11
12
12
> Note: the below information is for reference purposes only, and are not
13
- > intended to be used as guidelines for infrastructure sizing.
13
+ > intended to be used as guidelines for infrastructure sizing. Review the
14
+ > [ Reference Architectures] ( architectures/index.md ) for hardware sizing
15
+ > recommendations.
14
16
15
17
| Environment | Coder CPU | Coder RAM | Coder Replicas | Database | Users | Concurrent builds | Concurrent connections (Terminal/SSH) | Coder Version | Last tested |
16
18
| ---------------- | --------- | --------- | -------------- | ----------------- | ----- | ----------------- | ------------------------------------- | ------------- | ------------ |
@@ -29,66 +31,86 @@ Since Coder's performance is highly dependent on the templates and workflows you
29
31
support, you may wish to use our internal scale testing utility against your own
30
32
environments.
31
33
32
- > Note: This utility is intended for internal use only. It is not subject to any
33
- > compatibility guarantees, and may cause interruptions for your users. To avoid
34
- > potential outages and orphaned resources, we recommend running scale tests on
35
- > a secondary "staging" environment. Run it against a production environment at
36
- > your own risk.
34
+ > Note: This utility is experimental. It is not subject to any compatibility
35
+ > guarantees, and may cause interruptions for your users. To avoid potential
36
+ > outages and orphaned resources, we recommend running scale tests on a
37
+ > secondary "staging" environment or a dedicated
38
+ > [ Kubernetes playground cluster] ( https://github.com/coder/coder/tree/main/scaletest/templates ) .
39
+ > Run it against a production environment at your own risk.
37
40
38
- ### Workspace Creation
41
+ ### Create workspaces
39
42
40
- The following command will run our scale test against your own Coder deployment.
41
- You can also specify a template name and any parameter values .
43
+ The following command will provision a number of Coder workspaces using the
44
+ specified template and extra parameters .
42
45
43
46
``` shell
44
47
coder exp scaletest create-workspaces \
45
- --count 1000 \
46
- --template " kubernetes" \
47
- --concurrency 0 \
48
- --cleanup-concurrency 0 \
49
- --parameter " home_disk_size=10" \
50
- --run-command " sleep 2 && echo hello"
48
+ --retry 5 \
49
+ --count " ${SCALETEST_PARAM_NUM_WORKSPACES} " \
50
+ --template " ${SCALETEST_PARAM_TEMPLATE} " \
51
+ --concurrency " ${SCALETEST_PARAM_CREATE_CONCURRENCY} " \
52
+ --timeout 5h \
53
+ --job-timeout 5h \
54
+ --no-cleanup \
55
+ --output json:" ${SCALETEST_RESULTS_DIR} /create-workspaces.json"
51
56
52
57
# Run `coder exp scaletest create-workspaces --help` for all usage
53
58
```
54
59
55
- The test does the following:
60
+ The command does the following:
56
61
57
- 1 . create ` 1000 ` workspaces
58
- 1 . establish SSH connection to each workspace
59
- 1 . run ` sleep 3 && echo hello ` on each workspace via the web terminal
60
- 1 . close connections, attempt to delete all workspaces
61
- 1 . return results (e.g. ` 998 succeeded, 2 failed to connect ` )
62
-
63
- Concurrency is configurable. ` concurrency 0 ` means the scaletest test will
64
- attempt to create & connect to all workspaces immediately.
65
-
66
- If you wish to leave the workspaces running for a period of time, you can
67
- specify ` --no-cleanup ` to skip the cleanup step. You are responsible for
68
- deleting these resources later.
62
+ 1 . Create ` ${SCALETEST_PARAM_NUM_WORKSPACES} ` workspaces concurrently
63
+ (concurrency level: ` ${SCALETEST_PARAM_CREATE_CONCURRENCY} ` ) using the
64
+ template ` ${SCALETEST_PARAM_TEMPLATE} ` .
65
+ 1 . Leave workspaces running to use in next steps (` --no-cleanup ` option).
66
+ 1 . Store provisioning results in JSON format.
67
+ 1 . If you don't want the creation process to be interrupted by any errors, use
68
+ the ` --retry 5 ` flag.
69
69
70
70
### Traffic Generation
71
71
72
72
Given an existing set of workspaces created previously with ` create-workspaces ` ,
73
- the following command will generate traffic similar to that of Coder's web
74
- terminal against those workspaces.
73
+ the following command will generate traffic similar to that of Coder's Web
74
+ Terminal against those workspaces.
75
75
76
76
``` shell
77
+ # Produce load at about 1000MB/s (25MB/40ms).
77
78
coder exp scaletest workspace-traffic \
78
- --byes-per-tick 128 \
79
- --tick-interval 100ms \
80
- --concurrency 0
79
+ --template " ${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE} " \
80
+ --bytes-per-tick $(( 1024 * 1024 * 25 )) \
81
+ --tick-interval 40ms \
82
+ --timeout " $(( delay)) s" \
83
+ --job-timeout " $(( delay)) s" \
84
+ --scaletest-prometheus-address 0.0.0.0:21113 \
85
+ --target-workspaces " 0:100" \
86
+ --trace=false \
87
+ --output json:" ${SCALETEST_RESULTS_DIR} /traffic-${type} -greedy-agent.json"
81
88
```
82
89
83
- To generate SSH traffic, add the ` --ssh ` flag.
90
+ Traffic generation can be parametrized:
91
+
92
+ 1 . Send ` bytes-per-tick ` every ` tick-interval ` .
93
+ 1 . Enable tracing for performance debugging.
94
+ 1 . Target a range of workspaces with ` --target-workspaces 0:100 ` .
95
+ 1 . For dashboard traffic: Target a range of users with ` --target-users 0:100 ` .
96
+ 1 . Store provisioning results in JSON format.
97
+
98
+ The ` workspace-traffic ` supports also other modes - SSH traffic, workspace app:
99
+
100
+ 1 . For SSH traffic: Use ` --ssh ` flag to generate SSH traffic instead of Web
101
+ Terminal.
102
+ 1 . For workspace app traffic: Use ` --app [wsdi|wsec|wsra] ` flag to select app
103
+ behavior. (modes: _ WebSocket discard_ , _ WebSocket echo_ , _ WebSocket read_ ).
84
104
85
105
### Cleanup
86
106
87
107
The scaletest utility will attempt to clean up all workspaces it creates. If you
88
108
wish to clean up all workspaces, you can run the following command:
89
109
90
110
``` shell
91
- coder exp scaletest cleanup
111
+ coder exp scaletest cleanup \
112
+ --cleanup-job-timeout 2h \
113
+ --cleanup-timeout 15min
92
114
```
93
115
94
116
This will delete all workspaces and users with the prefix ` scaletest- ` .
0 commit comments