You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Batch API: upper limit of the number of objects per batch #419
The current implementation of the batch api client code in v0.5.2 scans the commits for all Git LFS objects, and then sends them all in a single POST to /objects/batch. A reasonable limit on the number of objects per post would relieve the server from having to worry about a potentially massive in-memory hash parsed from JSON. This limit should be mentioned in the API specs so servers can implement the limit as well.
We could define a upper bound for the upper limit to restrict it to values <= 100. This way it's possible to let users lower the upper limit without putting to much stress on the server. My intention with “making it configurable” was to let users define lower upper limits than any constant in the client's code.
A reasonable limit on the number of objects per post would relieve the server from having to worry about a potentially massive in-memory hash parsed from JSON. This limit should be mentioned in the API specs so servers can implement the limit as well.
A malicious client could still send whatever it wants. Would it be possible for servers to reject POST requests with an “to many objects” error? (I'm not familiar enough with the current batch API.)
A malicious client could still send whatever it wants. Would it be possible for servers to reject POST requests with an “to many objects” error? (I'm not familiar enough with the current batch API.)
Yeah, they can return that with a 400 or 422 status. Web servers like nginx will also have some lower level setting to restrict the body size.
Starting with #476, we're rolling with 100 for the initial batch size. This could definitely change depending on our benchmarking results with the new server.
Activity
michael-k commentedon Jun 19, 2015
👍
We should make it configurable.
technoweenie commentedon Jun 19, 2015
Making it configurable is fine, but it could cause problems if there's a mismatch between the configured client and various servers.
michael-k commentedon Jun 20, 2015
We could define a upper bound for the upper limit to restrict it to values
<= 100. This way it's possible to let users lower the upper limit without putting to much stress on the server. My intention with “making it configurable” was to let users define lower upper limits than any constant in the client's code.A malicious client could still send whatever it wants. Would it be possible for servers to reject POST requests with an “to many objects” error? (I'm not familiar enough with the current batch API.)
technoweenie commentedon Jun 22, 2015
Yeah, they can return that with a 400 or 422 status. Web servers like nginx will also have some lower level setting to restrict the body size.
technoweenie commentedon Jun 22, 2015
Related: we should also strip objects that are already in
.git/lfs/objects: #430technoweenie commentedon Jul 27, 2015
Starting with #476, we're rolling with 100 for the initial batch size. This could definitely change depending on our benchmarking results with the new server.