File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,30 @@ When applying multiple rate limits (e.g. a global limit and a more strict limit
65
65
for a specific endpoint), set this to a unique value on each to prevent
66
66
double-counting of visits.
67
67
68
+ ## Usage with PM2, gatling, and other process managers
69
+
70
+ Because this store requires code execution in the primary process, it doesn't
71
+ work with process managers that need full control of the primary process,
72
+ including PM2 when in ` cluster ` mode.
73
+
74
+ ### PM2
75
+
76
+ To work with [ PM2] ( https://pm2.keymetrics.io/ ) , use the following configuration:
77
+
78
+ instances: 1,
79
+ exec_mode: 'fork',
80
+
81
+ And then edit your main JS file to include the clustering code, similar to
82
+ [ this example] ( https://github.com/express-rate-limit/cluster-memory-store/blob/8745cb4da4035f84255e1c0146951a0fe2fbcc10/example/server.js ) .
83
+
84
+ This looses some of the benefits of using PM2, because it can no longer directly
85
+ manage worker processes.
86
+
87
+ ### Gatling
88
+
89
+ [ Gatling] ( https://www.npmjs.com/package/gatling ) is not currently compatibile
90
+ with ` cluster-memory-store ` .
91
+
68
92
## Issues and Contributing
69
93
70
94
If you encounter a bug or want to see something added/changed, please go ahead
You can’t perform that action at this time.
0 commit comments