core icon indicating copy to clipboard operation
core copied to clipboard

Performance issue with stream download

Open chintan3100 opened this issue 9 years ago • 5 comments

I am downloading 400 MB file on local machine with 7 MB/Second (.net core 2.0) same code run with .net framework 4.6 download speed 100 MB/Second.

public IActionResult DownloadDocument(Guid documentUniqueId) { var bytes = System.IO.File.OpenRead(@"D:\home\site\wwwroot\file\Organizer01_2017-09-03 (14) (3).zip"); return File(bytes, "application/octet-stream");

} File size 400 MB . API on local system. FIle on local system

chintan3100 avatar Sep 05 '17 08:09 chintan3100

@JeremyKuhne can we get this tracked in dotnet/corefx?

Petermarcu avatar Sep 05 '17 15:09 Petermarcu

This issue was also opened as: https://github.com/aspnet/Performance/issues/246

@chintan3100 We need to know exactly how the FileStream is being written. What is the File class you're using? If you're writing via ASP.NET apis it would probably be better to start on that end.

JeremyKuhne avatar Sep 06 '17 02:09 JeremyKuhne

I am using .net core. Please refer below code

public IActionResult DownloadDocument(Guid documentUniqueId) { var bytes = System.IO.File.OpenRead(@"D:\home\site\wwwroot\file\Organizer01_2017-09-03 (14) (3).zip"); return File(bytes, "application/octet-stream");

}

chintan3100 avatar Sep 09 '17 02:09 chintan3100

Presumably you're talking about System.Web.Mvc.Controller.File. You should probably start with https://github.com/aspnet/Mvc/issues. The ASP.NET team is the right starting point.

JeremyKuhne avatar Sep 09 '17 05:09 JeremyKuhne

Moved this issue here: https://github.com/aspnet/Home/issues/2233

Petermarcu avatar Oct 07 '17 06:10 Petermarcu