minimalchat / daemon

Minimal Chat's API server daemon
https://minimal.chat
BSD 3-Clause "New" or "Revised" License
55 stars 8 forks source link

Daemon crashes under high load #22

Closed mihok closed 7 years ago

mihok commented 7 years ago

After some preliminary load testing using artillery; testing at high load causes a concurrent map write error [0]:

fatal error: concurrent map iteration and map write

Under the following load test conditions:

Phase 0 (High load phase) started - duration: 600s

Report for the previous 10s @ 2017-07-09T12:23:16.646Z
  Scenarios launched:  450
  Scenarios completed: 78
  Requests completed:  79
  Concurrent users:    338
  RPS sent: 8.4
  Request latency:
    min: 0
    max: 5.8
    median: 0.3
    p95: 2.5
    p99: 5.6
  Scenario duration:
    min: 227.1
    max: 7655.5
    median: 1596.6
    p95: 5999
    p99: 7378.6
  Codes:
    0: 79
  Errors:
    xhr poll error: 21

Report for the previous 10s @ 2017-07-09T12:23:26.653Z
  Scenarios launched:  500
  Scenarios completed: 103
  Requests completed:  128
  Concurrent users:    735
  RPS sent: 12.08
  Request latency:
    min: 0
    max: 2.7
    median: 0.1
    p95: 0.4
    p99: 2
  Scenario duration:
    min: 6013.1
    max: 16370.8
    median: 10130.7
    p95: 14708.4
    p99: 16310.3
  Codes:
    0: 128

Report for the previous 10s @ 2017-07-09T12:23:36.656Z
  Scenarios launched:  500
  Scenarios completed: 8
  Requests completed:  9
  Concurrent users:    1165
  RPS sent: 0.85
  Request latency:
    min: 0
    max: 0.3
    median: 0.2
    p95: NaN
    p99: NaN
  Scenario duration:
    min: 14549.8
    max: 19315.3
    median: 16963.3
    p95: NaN
    p99: NaN
  Codes:
    0: 9
  Errors:
    xhr poll error: 41

[0] gist: Daemon log from load testing