c# - ASP.net: Concurrent file upload Fails after N number of large uploads -


i working on asp.net (webforms, asp.net 2.0, framework 3.5) application. 32 bit application running on iis 7.0, os windows 2008 r2 sp1

i facing issue large file uploads. files more 20 mb or so. application able upload large files however, noticed after n number of uploads, next set of uploads keep on failing until iis restarted.

the application supports concurrent file uploads. noticed that, single large file upload works. when start upload more 1 file, 1 of uploads stuck.

i tried looking @ temp folders in posted file data gets uploaded , noticed when issue happens, upload failing file never starts server's view point never generates temp file , after few sec, request fails.

when things fail, cpu ok w3wp stands @ 2 gb memory usage (against total 4 gb ram) w3wp not show crash other pages of application still works fine

i tried using wireshark see network traffic, err_connection_reset. apart that, not getting clue.

i suspecting below things not sure how conclude or fix. 1) start concurrent uploads, server needs cop data pumping rate client side , when unable match that, must failing internally. due server's inability server concurrent requests. 2) frequent large uploads increases memory footprint of application extent cannot work concurrent uploads, because dump files @ temporary location in chunked manner, ram still required

here web config setting

<httpruntime maxrequestlength="2097151" executiontimeout="10800" enableversionheader="false"/> 

from implementation perspective, 1) have client side implementation written in java script, creates formdata , sends xhr server 2) server has method gets called when complete file copied server's temp directory, , extract file data using request.files collection , processes further

when issue happens, server method gets called, request.files comes empty.

please let me know if have insight on can guide me root cause , fix.

update: client side code representation:

 //set http headers _http.setrequestheader("x-uploadmethod", "formdata"); _http.setrequestheader("x-filename", "name of file");  // prepare form data var data = new formdata(); data.append("name of file", file contents);  //sends xhr request _http.send(data); 

server side code representation:

httpfilecollection files = request.files; int id = objupload.uploadmyassets(files[0]); 

the logic in uploadmyassets taking files[0] httppostedfile , move ahead application specific logic.

thanks


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -