<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 5, 2021 at 1:42 AM sharad yadav <<a href="mailto:sharad.openbmc@gmail.com">sharad.openbmc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>We have tried to measure redfish APIs performance benchmarking on AST2600.</div><div>On redfish GET request there is a penalty added for ~100ms on TLS handshake at</div><div><a href="https://github.com/openbmc/bmcweb/blob/master/http/http_connection.hpp#L297" target="_blank">https://github.com/openbmc/bmcweb/blob/master/http/http_connection.hpp#L297</a><br></div><div><br></div><div>On trying below all methods, each request calls `<span style="background-color:rgb(255,248,197);color:rgb(5,80,174);font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap">async_handshake</span>` which adds 100ms delay</div><div>before the actual redfish handler code gets called.</div><div><b>Method 1:</b></div><div>curl --insecure -X POST -D headers.txt https://${bmc}/redfish/v1/SessionService/Sessions -d    '{"UserName":"root", "Password":"0penBmc"}'<br></div><div>export token=<Read <span style="background-color:rgba(175,184,193,0.2);color:rgb(36,41,47);font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:13.6px">X-Auth-Token</span> from the headers.txt></div><div><span style="font-size:11pt;font-family:Calibri">curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/Systems/system</span><br></div><div><br></div><div><b>Method 2:</b></div><div><span style="font-size:11pt;color:rgb(36,41,46);font-family:Calibri">export token=`curl -k -H "Content-Type: application/json" -X POST https://${bmc}/login -d '{"username" : "root", "password" : "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`</span><br></div><div><span style="font-family:Calibri;font-size:14.6667px">curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/Systems/system</span><span style="font-size:11pt;color:rgb(36,41,46);font-family:Calibri"><br></span></div><div><br></div><div><b>Method 3:</b></div><div><span style="font-size:11pt;color:rgb(36,41,46);font-family:Calibri">curl https://${bmc}/redfish/v1/Systems/system --insecure -u root:0penBmc -L</span></div><div><br></div><div>We want to avoid this ~100ms delay for better performance.</div><div>Please suggest if there is a way to skip the `<span style="background-color:rgb(255,248,197);color:rgb(5,80,174);font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre-wrap">async_handshake` </span>call by modifying the requests method?</div><div><br></div><div>Thanks,</div><div>Sharad</div></div></blockquote><div><br></div><div><br></div><br>There is logic in the crow::connection object that should allow you to use tcp keep-alive and avoid the handshake in start.<br><a href="https://github.com/openbmc/bmcweb/blob/master/http/http_connection.hpp#L694">https://github.com/openbmc/bmcweb/blob/master/http/http_connection.hpp#L694</a><br> <br>I have looked at the connection class in bmcweb before, and found it difficult to understand. <br>However, this is a simplified version of the states within the connection class:<br> <br>start->doReadHeaders->doRead->handle->completeRequest->doWrite[if keep alive]->doReadHeaders<br> <br>The async_handshake is in the start, so if you are able to use the same connection, you should only pay for the handshake once. <br><div>Ed Tanous and Gunnar Mills are the definitive experts. </div><div><br></div><div>Let us know what you find. </div><div>Thank you</div></div></div>