ASP.Net Web Service: Prevent .tmp and .post files for large-ish POSTs -


i have c# .net 4.5 soap web service hosted in iis 8.5. service takes hits i've seen writing .tmp , .post files directory c:\windows\microsoft.net\framework64\v4.0.30319\temporary asp.net files\webservices_itcrateengine\2c7c6f10\8cbc7b94\uploads.

i have seen advice on interwebs detailing how move temp directory elsewhere via tag's tempdirectory attribute in web.config.
i've seen general piece of advice @ around ~250k upload size when asp.net write these .tmp , .post files, want know how can specify size @ asp.net buffers upload data disk via .tmp , .post files?
have lot of posts webservice throughout day, thousands hour, ranging in size 1k-1mb. these machines have plenty of memory if can change threshold .net uses buffering disk, expect lighter load on physical disks deem unnecessary io.
know how set upload size threshold asp.net use determine whether create these temporary .post , .tmp files? time.

asp.net file upload uses httppostedfile save file stream.from msdn documentation

files uploaded in mime multipart/form-data format. default, requests, including form fields , uploaded files, larger 256 kb buffered disk, rather held in server memory.

also regarding buffer

the amount of data buffered in server memory request, includes file uploads, can specified accessing requestlengthdiskthreshold property or setting requestlengthdiskthreshold attribute of httpruntime element (asp.net settings schema) element within machine.config or web.config file.

by adjusting maxrequestlength , requestlengthdiskthreshold properties, can fine tune performance of server

so can have higher setting in web.config e.g. 1024 kb

<httpruntime requestlengthdiskthreshold = "1024"  

specifies limit input stream buffering threshold, in kilobytes. value should not exceed maxrequestlength attribute.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -