Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request body size can be cut down to improve transmission efficiency #32

Open
panyy3 opened this issue Mar 1, 2019 · 6 comments
Open

Comments

@panyy3
Copy link

panyy3 commented Mar 1, 2019

No description provided.

@panyy3
Copy link
Author

panyy3 commented Mar 1, 2019

When reading the source code, I found that request body size can be cut down to improve transmission efficiency if update the line L712 in file python-redfish-library-master/src/redfish/rest/v1.py.
Before improve:
body = json.dumps(body)
After improve:
body = json.dumps(body, separators=(',',':'))

So I suggest to update code to improve transmission effeciency. Can anyone help on this?

@panyy3
Copy link
Author

panyy3 commented Mar 6, 2019

Compare the request json body
Before improve:
{"data": [48, 79, 121, 66, 84, 70, 120, 97, 84, 122, 74, 51, 43, 101, 88, 73, 51, 109]}
After improve:
{"data":[48,79,121,66,84,70,120,97,84,122,74,51,43,101,88,73,51,109]}
From the comparison, we can know that request body size is cut down, so the transmission efficiency is improved.

@panyy3
Copy link
Author

panyy3 commented Mar 6, 2019

Useless blank is removed from request body after improvement.

@mraineri
Copy link
Contributor

mraineri commented Mar 7, 2019

While we can see that it's definitely removing extra characters, do you have any measurements for performance improvements with this change? We don't suspect that there would be much change since since most of the time would be spent in opening/closing the connection, and not necessarily on the body of the payload.

@panyy3
Copy link
Author

panyy3 commented Mar 8, 2019

Yes, you are right. Most of the time would be spent in opening/closing the connection.
Although I have no measurements for this change, request body payload size will also impact the Redfish service server side's dealing. Server will need more space to deal the body payload with useless blanks, and will easily to reach the dealing body size limitation. This change will help to avoid this kind of problem.

@mraineri
Copy link
Contributor

We could add it as an optional parameter to compress the payload. Realistically speaking, we're not seeing a huge problem with size limitations in client requests (generally speaking, they tend to be over 1MB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants