TCP connection is closed after each response
davdr opened this issue · 2 comments
After each REST request (after receiving the response) the TCP connection to the server is closed. Is this intentional?
This happens here:
python-redfish-library/src/redfish/rest/v1.py
Line 852 in 2a36b9c
Any "Connection: Keep-Alive" is not honored. Note that a bit earlier in the code it is honored:
python-redfish-library/src/redfish/rest/v1.py
Line 817 in 2a36b9c
Closing the connection every time is quite inefficient, as every subsequent request then requires setting up a new TCP connection, and in case of https, repeating the SSL/TLS negotiation.
On my test system, keeping the connection open instead of closing it, reduces execution time for https://github.com/DMTF/Redfish-Tacklebox/blob/master/scripts/rf_sensor_list from ~25 seconds to ~12 seconds.
I'm not sure why it was done like that in the first place; I agree it seems strange.
@jautor any idea about the history of that?
Everything I've found indicates it was done that way during early development of the standard, when implementations were "new". But those days are long past, and we see no reason to keep that inefficient behavior.