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

Make the request body limit configurable (and increase the default) #1762

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

hannahbast
Copy link
Member

@hannahbast hannahbast commented Feb 4, 2025

There is now a runtime parameter request-body-limit with a default size of 100 MB. Previously, the implicit limit of Boost's http::request was used, which was 1 MB. When sending large requests via curl use a call like this:

curl -s localhost:7001 -H "Authorization: Bearer bla" -H "Content-type: application/sparql-update" --data-binary @file_with_insert_data > update-result.json

Sending an INSERT DATA currently takes around 40 second per one million triples, which is rather slow because the triples are parsed using the SPARQL parser. They should rather be parser with our RDF parser, which is work for a separate PR. See also #1756 (comment)

@hannahbast hannahbast changed the title Request size limit HOW TO increase the request size limit Feb 4, 2025
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.16%. Comparing base (dffbc2b) to head (4889498).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/util/http/HttpServer.h 80.95% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1762      +/-   ##
==========================================
- Coverage   90.18%   90.16%   -0.03%     
==========================================
  Files         399      401       +2     
  Lines       38374    38468      +94     
  Branches     4293     4311      +18     
==========================================
+ Hits        34608    34684      +76     
- Misses       2473     2485      +12     
- Partials     1293     1299       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RobinTF
Copy link
Collaborator

RobinTF commented Feb 5, 2025

@hannahbast This seems to be a duplicate of #1089

Copy link
Member Author

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-1 with Julian, we tested this quite a bit and it works. Some minor suggestions:

  1. Error handling when body limit is exceeded (right now the request does nothing and sends an empty reply)
  2. Increase the default limit from 1 MB to 100 MB
  3. Move the #include of util/http/HttpServer.h from Server.h to Server.cpp
  4. Abbreviate large updates in the returned JSON (this is probably a PR on its own)
  5. Fix copyright note at the top of HttpServer.h

@hannahbast hannahbast changed the title HOW TO increase the request size limit Make the request body limit configurable (and increase the default) Feb 21, 2025
@sparql-conformance
Copy link

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

Successfully merging this pull request may close these issues.

3 participants