You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing.md
+20-19Lines changed: 20 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,18 @@ $ cachix use nxpg
16
16
# might take a while in downloading all the dependencies
17
17
$ nix-shell
18
18
19
+
# test on latest pg
20
+
$ xpg test
21
+
19
22
# test on pg 12
20
23
$ xpg -v 12 test
21
24
22
25
# test on pg 13
23
26
$ xpg -v 13 test
24
27
```
25
28
29
+
This will spawn a local db and an nginx server for testing.
30
+
26
31
### Debugging
27
32
28
33
You can turn on logging level to see curl traces with
@@ -66,32 +71,28 @@ $ sudo net-with-gdb
66
71
67
72
## Load Testing
68
73
69
-
These are scripts that wrap NixOps to deploy an AWS cloud setup. You must have `default` setup in `.aws/credentials`.
70
-
71
-
```bash
72
-
net-cloud-deploy
73
-
```
74
+
The `net-loadtest` launchs a temporary db and a nginx server, waiting until a number of requests are done, then reporting results (plus process monitoring) at the end.
74
75
75
-
Then you can connect on the client instance and do requests to the server instance through `pg_net`.
76
+
It takes a two parameters: the number of requests (GETs) and the `pg_net.batch_size`.
76
77
77
78
```bash
78
-
net-cloud-ssh
79
-
80
-
psql -U postgres
79
+
$ net-loadtest 1000 200
80
+
...
81
81
82
-
selectnet.http_get('http://server');
83
-
# this the default welcome page of nginx on the server instance
84
-
# "server" is already included to /etc/hosts, so `curl http://server` will give the same result
82
+
## Loadtest results
85
83
86
-
# do some load testing
87
-
selectnet.http_get('http://server') from generate_series(1,1000);
88
-
# run `top` on another shell(another `nixops ssh -d pg_net client`) to check the worker behavior
0 commit comments