git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1] Make upload-pack pack write size configurable

From
Jacob Vosmaer <jacob@gitlab.com>
Date
Dec 13, 2021, 13:23 UTC
Message-ID
<20211213132345.26310-1-jacob@gitlab.com>

When transfering packfile data, upload-pack.c uses an 8KB buffer. This is a reasonable size but when you transfer a lot of packfile data, like we do on GitLab.com, we find it is beneficial to use a larger buffer size.

Below you will find a commit where we make the size of this 8KB buffer configurable at compile time. It appears pack-objects always does 8KB writes so I don't think we should change the default. But for GitLab, where we have a cache for the output of pack-objects, it is beneficial to use a larger IO size because the cache does 64KB writes.

I have also considered converting the packfile copying code to use stdio when writing to stdout, but that would be a bigger change because we have to be careful not to interleave stdio and stdlib writes. And we would have to make the stdout output buffer size configurable, because the default stdio buffer size is 4KB which is no better than the status quo. A final argument against the stdio approach is that it only reduces the number of writes from upload-pack, while a larger buffer size reduces both the number of reads and writes.

Having said all that, if the Git maintainers prefer the stdio approach over this compile time constant, I am happy to submit a patch series for that instead.

Thanks,
Jacob Vosmaer
Jacob Vosmaer (1):
  upload-pack.c: make output buffer size configurable
 upload-pack.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
-- 
2.33.0
Next: Jacob Vosmaer
Message 1 of 17 in “Make upload-pack pack write size configurable”
  1. 0/1 Make upload-pack pack write size configurableJacob Vosmaer, Dec 13, 2021
  2. 1/1 upload-pack.c: make output buffer size configurableJacob Vosmaer, Dec 13, 2021
  3. Ævar Arnfjörð BjarmasonDec 14, 2021
  4. Jeff KingDec 14, 2021
  5. 0/1 upload-pack.c: increase output buffer sizeJacob Vosmaer, Dec 14, 2021
  6. 1/1 upload-pack.c: increase output buffer sizeJacob Vosmaer, Dec 14, 2021
  7. Ævar Arnfjörð BjarmasonDec 14, 2021
  8. Jeff KingDec 15, 2021
  9. Junio C HamanoDec 15, 2021
  10. rsbecker@nexbridge.comDec 15, 2021
  11. Jacob VosmaerDec 15, 2021
  12. rsbecker@nexbridge.comDec 15, 2021
  13. Jacob VosmaerDec 15, 2021
  14. rsbecker@nexbridge.comDec 15, 2021
  15. Jeff KingDec 14, 2021
  16. Jacob VosmaerDec 14, 2021
  17. Jeff KingDec 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.