Skip to content

Commit cca551d

Browse files
committed
Add Background informations about max_form_buffer
1 parent b6d7f60 commit cca551d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In this handler are the following modules in use.
1818

1919
=== Parameters
2020

21-
.Table Parameters
21+
.Parameters
2222
[cols="2,6",options=header]
2323
|===
2424
|Name
@@ -31,7 +31,7 @@ In this handler are the following modules in use.
3131
|The response template after a upload was successfully
3232

3333
|**max_form_buffer**
34-
|The maximum buffer size for https://pkg.go.dev/net/http#Request.ParseMultipartForm[ParseMultipartForm]. The default size is **1G**
34+
|The maximum buffer size for https://pkg.go.dev/net/http#Request.ParseMultipartForm[ParseMultipartForm]. It accepts all size values supported by https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants[go-humanize]. The default size is **1G**.
3535

3636
|**max_size**
3737
|is the maximum size in bytes allowed for the upload.
@@ -198,5 +198,6 @@ http.upload.filesize: {{placeholder "http.upload.filesize"}}
198198

199199
== Background informations
200200

201-
The **max_form_buffer** paramater will be directly passed to https://cs.opensource.google/go/go/+/refs/tags/go1.18.2:src/mime/multipart/formdata.go;l=34;drc=7791e934c882fd103357448aee0fd577b20013ce[readForm] function and is used to check if the uploaded file should be saved temporarly on disk or keep it in the memory. This have dicret impact into the performance and disk usage of that module. Keep in mind when this paramter is low and the upload is a big file then will be there a lot of disk io.
201+
The **max_form_buffer** paramater will be directly passed to https://cs.opensource.google/go/go/+/refs/tags/go1.18.2:src/mime/multipart/formdata.go;l=34;drc=7791e934c882fd103357448aee0fd577b20013ce[readForm] function and is used to check if the uploaded file should be saved temporarly on disk or keep it in the memory. This have dicret impact into the performance and disk usage of that module. Keep in mind when this paramter is low and the upload is a big file then will be there a lot of disk io. +
202202

203+
INFO: The observation from https://github.com/etherwvlf in issue https://github.com/git001/caddyv2-upload/issues/2[Memory issues on large uploads] was that the initial memory usage is 7-8 times higher then the configured **max_form_buffer** size.

0 commit comments

Comments
 (0)