mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 20:55:47 +01:00
Performance on this real-life configuration: Before last commit: Service runtime: 2min 22.669s CPU time consumed: 3min 44.299s Memory peak: 50.7M (swap: 0B) With last commit: Service runtime: 7.569s CPU time consumed: 21.998s Memory peak: 105.6M (swap: 0B)
74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
---
|
|
# This configuration permits to test reaction's performance
|
|
# under a very high load
|
|
#
|
|
# It keeps regexes super simple, to avoid benchmarking the `regex` crate,
|
|
# and benchmark reaction's internals instead.
|
|
concurrency: 32
|
|
|
|
patterns:
|
|
num:
|
|
regex: '[0-9]{3}'
|
|
ip:
|
|
regex: '(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})|(?:[0-9a-fA-F:]{2,90})'
|
|
ignore:
|
|
- 1.0.0.1
|
|
|
|
streams:
|
|
tailDown1:
|
|
cmd: [ 'sh', '-c', 'sleep 2; seq 10001 | while read i; do echo found $i; done' ]
|
|
filters:
|
|
find1:
|
|
regex:
|
|
- '^found <num>'
|
|
retry: 9
|
|
retryperiod: 6m
|
|
actions:
|
|
damn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
undamn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
after: 1m
|
|
onexit: false
|
|
tailDown2:
|
|
cmd: [ 'sh', '-c', 'sleep 2; seq 1000100 | while read i; do echo found $i; echo trouvé $i; done' ]
|
|
filters:
|
|
find2:
|
|
regex:
|
|
- '^found <num>'
|
|
retry: 480
|
|
retryperiod: 6m
|
|
actions:
|
|
damn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
undamn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
after: 1m
|
|
onexit: false
|
|
tailDown3:
|
|
cmd: [ 'sh', '-c', 'sleep 2; seq 1000100 | while read i; do echo found $i; echo trouvé $i; done' ]
|
|
filters:
|
|
find3:
|
|
regex:
|
|
- '^found <num>'
|
|
retry: 480
|
|
retryperiod: 6m
|
|
actions:
|
|
damn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
undamn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
after: 1m
|
|
onexit: false
|
|
find4:
|
|
regex:
|
|
- '^trouvé <num>'
|
|
retry: 480
|
|
retryperiod: 6m
|
|
actions:
|
|
damn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
undamn:
|
|
cmd: [ 'sleep', '0.0<num>' ]
|
|
after: 1m
|
|
onexit: false
|