|
Post by scottbusi on Mar 29, 2021 0:47:48 GMT
We are developing some server monitor tools that are time sensitive and have noticed that a GET with curl completes much faster than a GET in a python script. Is thus normal and if so why?
|
|
|
Post by mraineri on Mar 29, 2021 12:31:20 GMT
Do you have any metrics you're able to share with us? Nothing really cross my mind at the moment, and I have not noticed much of a discrepancy before, but I'll certainly pay attention to that now.
|
|
|
Post by scottbusi on Apr 16, 2021 17:10:59 GMT
Hi, so using POSTMANN, curl, and a python script to do a get on /redfish/v1/Systems/Self we get these times
POSTMAN 10.17s CURL 17.01s python script 20.356s
We do not understand why there is such a difference in each method
|
|
|
Post by jautor on Apr 16, 2021 20:49:16 GMT
Yikes, none of those response times are reasonable... For comparison, what is the ping response times for your system?
And to try to reduce the number of variables, are you using Basic Auth or a Redfish Session for all of these? I want to make sure we're not getting "session creation / teardown" mixed in the comparisons.
For a clear first test, can you just try an unauthenticated GET on /redfish/v1 (the Service Root) and compare those results?
All of those times should be a small fraction of what you are seeing...
Jeff
|
|
|
Post by scottbusi on Apr 17, 2021 2:29:09 GMT
Thank you for the response, yes YIKES, those times are horrible and that is an issue that has to and is being worked. All of these should use Basic Auth, (just getting into Redfish so many questions) A basic Auth does not create a session? The python script is as follows BMC_IP="https://10.8.1.90" LOGIN="Administrator" PASSWRD="xxxxxxxx"
REDFISHOBJ = redfish.redfish_client(base_url=BMC_IP, username=LOGIN, password=PASSWRD)
# Login to the server REDFISHOBJ.login()
# Perform a GET operation response = REDFISHOBJ.get("/redfish/v1/Systems/Self", None)
print (response)
# Logout the created session REDFISHOBJ.logout()
curl curl --globoff -H "Content-Type: application/json" -k -X GET --user Administrator:superuser https://<BMC IP>/redfish/v1/Systems/Self | python -m json.tool
Network is fine: [root@scottsys scott]# ping 10.8.1.90 PING 10.8.1.90 (10.8.1.90) 56(84) bytes of data. 64 bytes from 10.8.1.90: icmp_seq=1 ttl=64 time=0.495 ms 64 bytes from 10.8.1.90: icmp_seq=2 ttl=64 time=0.477 ms
/redfish/v1 POSTMAN 3.10s Python 8.45s Curl 2.16s
So yes very horrible response times that we need to address but still why the difference in each method? If we are using basic Auth for each should we not see the same times for each URI?
|
|
|
Post by mraineri on Apr 19, 2021 13:57:59 GMT
I know the Redfish Python library will perform a few requests up front to probe the service: - redfish.redfish_client( ... ): This will perform a GET on /redfish/v1 to locate the sessions URI
- REDFISHOBJ.login(): This will interact with the session collection by either performing a POST to create a new session, or GET to sanity check the credentials for Basic Auth
So, in your sample script, it will perform three HTTP operations total; two for the construction and login using the Redfish library, and one for the GET operation you're performing. I assume that 8 seconds is the end-to-end completion of your Python script and not the individual call with "REDFISHOBJ.get"? If so, it makes sense why there's a discrepancy with curl and Postman.
|
|