summaryrefslogtreecommitdiff
path: root/http/ut
diff options
context:
space:
mode:
authorNan Zhou <nanzhoumails@gmail.com>2022-04-22 20:53:28 +0300
committerEd Tanous <ed@tanous.net>2022-06-01 23:17:42 +0300
commit72c3ae33bd127f8cd5887000a45adf13a56c7582 (patch)
tree5bf116f88a15b77deecfeff532388e2c55996d9c /http/ut
parentde167a6f30c0f32683480e06c6e81cfc9d4eb37b (diff)
downloadbmcweb-72c3ae33bd127f8cd5887000a45adf13a56c7582.tar.xz
Expand query: reimplement the way to do subqueries
For any expand query, the current implementation does all queries in a single MultiAsyncResp, where the code sends a bunch of requests without Query parameters. This makes it impossible to invoke efficient expand handlers, since efficent handlers will only be invoked when a query has $expand in its parameters. (Delegation only happens when the query contains query parameters) To solve it, in this commit, we proposed to send a bunch of requests **WITH** Query parameters in MultiAsyncResp. This makes "/redfish/v1/Chassis/chassis?expand=.($levels=2)" be able to invoke efficient expand handlers that we developed for sensors, which existing implementation can't do. This decreases latency by nearly 100 times (the improvement that efficient sensor expand handler provides) on real hardware which contains 5+ chassis and totally 220+ sensors. This commit aligns with future $select support well, since the recursive queries can add $select as part of the query parameters. With this commit, though we create multiple MultiAsyncResp objects memory doesn't increase significantly; part of the reason is that we are not copying Query anymore in MultiAsyncResp. No out-of-memory issues are found when 4 threads are querying expand=levels=6 at the service root on a real large hardware which contains 2+ sockets, 5+ chassis, 220+ sensors, 30+ DIMMs, etc. Tested: 1. On real hardware, /redfish/v1/Chassis?$expand=.(level=3) is giving the correct result and invokes efficient sensor Expand handler 2. stress test ``` for i in {1..4}; do echo "thread $i" wget -qO- 'http://localhost:18080/redfish/v1?$expand=*($levels=6)' > "/tmp/$i.log" & done for i in {1..1000}; do top -b -n 1 | grep bmcweb >> /tmp/bmcweb_ori.log sleep 1 done ``` Results ``` 25878 2856 root R 194m 20% 1 38% /tmp/bmcweb_after 19005 2856 root R 215m 22% 1 36% /tmp/bmcweb_ori ``` Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I0e661db0263f56dd0cab66047a0a5d4fff31b69a
Diffstat (limited to 'http/ut')
0 files changed, 0 insertions, 0 deletions