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
let it run for a few minutes and watch the CPU usage of the redis server - it will eventually max out a core
similar results on MacOS and Debian buster
good luck!
actually I'd be interested to learn how you tackle such a problem. My first thought would be profiling the redis-server, but I am fuzzy how that would work with a rust module
Hi there @mhaberler, sorry for the delay on this ( Was focusing on RedisConf related work and completely missed this one -- mea culpa :) ).
I've addressed this issue to myself, and will provide further feedback in the next couple of days.
@mhaberler confirmed that this is a very good use-case to profile further. Pre-steps
0.1) - Use the following RDB to mimic: https://s3.amazonaws.com/benchmarks.redislabs/gh/redisjson/295/dump.rdb
0.2) - Use the following memtier_benchmark command: memtier_benchmark --command '"JSON.ARRAPPEND" "path:sonde:foo" ".properties.coordinateProperties" "{\"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [26.2153, 60.34085, 417.0]}, \"properties\": {\"temp\": 3.6, \"serial\": \"S0730589\", \"humidity\": 64.6, \"vel_h\": 16.0, \"uploader_callsign\": \"Lahti 24h raspberry\", \"time\": 1617220020, \"uploader\": {\"callsign\": \"Lahti 24h raspberry\"}}}"' -n 25 --json-out-file 5k.arrappend-results.json
0.3) - Using the current RedisJSON master version: commit=445aa844. Redis v6.2.0 standalone instance.
Initial analysis steps
Using your script just to set the initial json and then using memtier_benchmark to fully top-up the Redis Instance we can see that:
Complexity is not O(1) even for a low number of array elements. We start at around 200ms p50 ( even though not stable at all but good enough to see the problem ) and move to 400-600ms p50 lat.
With 200 concurrent clients, we're observing a very poor performance ( 50 ops/sec @436ms p50 latency including RTT ).
4 Threads
50 Connections per thread
25 Requests per client
ALL STATS
============================================================================================================
Type Ops/sec Avg. Latency p50 Latency p99 Latency p99.9 Latency KB/sec
------------------------------------------------------------------------------------------------------------
"json.arrappend"s 53.47 420.36245 436.22300 987.13500 987.13500 20.35
Totals 53.47 420.36245 436.22300 987.13500 987.13500 20.35
Even using a simpler ARRAPEND command we see the same perf patterns: try it with memtier_benchmark --command '"JSON.ARRAPPEND" "path:sonde:foo" ".geometry.coordinates" "[47, 15, 920]"'
@gkorland@rafie this is indeed a regression ( comparing master commit=445aa844 vs v1.0.7 ). If possible take a look at pub fn value_op<F>(&mut self, path: &str, mut fun: F) -> Result<Value, Error> and inner fn's. Added the on cpu top consumers bellow.
v1.0.7 Results ( Use the following RDB: https://s3.amazonaws.com/benchmarks.redislabs/gh/redisjson/295/dumpv1.0.7.rdb ):
Used HW:
The performance results provided in this issue were collected using:
Hardware platform: A physical HPE ProLiant DL380 Gen10 Server, with one Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz, Maximum memory capacity of 3 TB, disabling CPU Frequency Scaling and with all configurable BIOS and CPU system settings set to performance.
OS: Ubuntu 18.04 Linux release 4.15.0-123.
Installed Memory: 64GB DDR4-SDRAM @ 2933 MHz
Activity
filipecosta90 commentedon Mar 30, 2021
@mhaberler can you share more details about the data, the specific arguments used on JSON.ARRAPPEND and version of RedisJSON?
mhaberler commentedon Mar 31, 2021
will try to reproduce in an example
code to reproduce RedisJSON/RedisJSON#295 (comment)
mhaberler commentedon Mar 31, 2021
here it is: https://github.com/mhaberler/rejson-perf
it does 100 arrappends/s on a json object
let it run for a few minutes and watch the CPU usage of the redis server - it will eventually max out a core
similar results on MacOS and Debian buster
good luck!
actually I'd be interested to learn how you tackle such a problem. My first thought would be profiling the redis-server, but I am fuzzy how that would work with a rust module
mhaberler commentedon Apr 20, 2021
any progress on this issue?
That'd be a release stopper bug in my book
filipecosta90 commentedon Apr 20, 2021
Hi there @mhaberler, sorry for the delay on this ( Was focusing on RedisConf related work and completely missed this one -- mea culpa :) ).
I've addressed this issue to myself, and will provide further feedback in the next couple of days.
mhaberler commentedon Apr 20, 2021
thanks for the update - really hope this gets fixed or I need to look for an alternative
filipecosta90 commentedon Apr 21, 2021
@mhaberler confirmed that this is a very good use-case to profile further.
Pre-steps
0.1) - Use the following RDB to mimic: https://s3.amazonaws.com/benchmarks.redislabs/gh/redisjson/295/dump.rdb
0.2) - Use the following memtier_benchmark command:
memtier_benchmark --command '"JSON.ARRAPPEND" "path:sonde:foo" ".properties.coordinateProperties" "{\"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [26.2153, 60.34085, 417.0]}, \"properties\": {\"temp\": 3.6, \"serial\": \"S0730589\", \"humidity\": 64.6, \"vel_h\": 16.0, \"uploader_callsign\": \"Lahti 24h raspberry\", \"time\": 1617220020, \"uploader\": {\"callsign\": \"Lahti 24h raspberry\"}}}"' -n 25 --json-out-file 5k.arrappend-results.json0.3) - Using the current RedisJSON master version:
commit=445aa844. Redis v6.2.0 standalone instance.Initial analysis steps
Using your script just to set the initial json and then using memtier_benchmark to fully top-up the Redis Instance we can see that:
memtier_benchmark --command '"JSON.ARRAPPEND" "path:sonde:foo" ".geometry.coordinates" "[47, 15, 920]"'filipecosta90 commentedon Apr 21, 2021
TODOs that will provide right away @mhaberler:
mhaberler commentedon Apr 21, 2021
boy, did I pick the right command :-)
filipecosta90 commentedon Apr 21, 2021
@gkorland @rafie this is indeed a regression ( comparing master
commit=445aa844vs v1.0.7 ). If possible take a look atpub fn value_op<F>(&mut self, path: &str, mut fun: F) -> Result<Value, Error>and inner fn's. Added the on cpu top consumers bellow.v1.0.7 Results ( Use the following RDB:
https://s3.amazonaws.com/benchmarks.redislabs/gh/redisjson/295/dumpv1.0.7.rdb):master version results ( Use the following RDB:
https://s3.amazonaws.com/benchmarks.redislabs/gh/redisjson/295/dump.rdb):Rust Hotspots:

PS: to properly detect the on-cpu hotspots I've changed the build rule to:
Used HW:
The performance results provided in this issue were collected using:
Hardware platform: A physical HPE ProLiant DL380 Gen10 Server, with one Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz, Maximum memory capacity of 3 TB, disabling CPU Frequency Scaling and with all configurable BIOS and CPU system settings set to performance.
OS: Ubuntu 18.04 Linux release 4.15.0-123.
Installed Memory: 64GB DDR4-SDRAM @ 2933 MHz
filipecosta90 commentedon Apr 21, 2021
@mhaberler while we sort the current master version regression can you proceed with version 1.0.7 ? This regression should not be visible there. WDYT?
filipecosta90 commentedon Apr 26, 2021
@mhaberler notice that #324 deeply improves the performance of the operation.
mhaberler commentedon Apr 26, 2021
will have a look