I have a Servlet with the following annotation, very basic.
@MultipartConfig
(
fileSizeThreshold = 1024 * 1024 * 1, // 1 MB
maxFileSize = 1024 * 1024 * 30, // 30 MB
maxRequestSize = 1024 * 1024 * 35, // 35 MB
location = "/somewhere"
)
The reason for my post is the setting, fileSizeThreshold. As I understand it, fileSizeThreshold sets the threshold for holding the file in memory before it's written to disk. I understand that the default is 0, and in the above code snippet, once 1mb was reached with an incoming file it would start to be written to disk.
What is the point of this setting? Is there an advantage to increasing the amount of the file in memory before a write?
I have an application where 80% of file uploads are <5mb, but we do get bigger files in the 25-30mb range. We're even looking at increasing the max to 50mb.
Every article I can find on MultipartConfig describes what fileSizeThreshold does but not how/when to use it... does anyone have any advice given the file requirements in the previous paragraph? If it makes a difference, we run glassfish4 on a ubuntu box.
Thanks in advance!