Hybrid View
-
03-17-2008, 09:56 AM #1Member
- Join Date
- Sep 2004
- Location
- Louisiana, USA.
- Posts
- 7,431
Web programmers' advice needed- the plot thickens.
Now it's become a full fledge war between me and the network people:
Here are the data using a 65MB document as test. Production server on domain A, Development server (my laptop) on its own workgroup.
Launching request from users' PCs that are in same domain as Production server.
Production server: Web app transfer = 24 minutes.
Production server: Webshare (no code) transfer = 12 sec
Development server: Web app transfer = 15 sec
Development server: Webshare (no code) transfer = 15 sec
Launching request from Internet Explorer on Development server:
Production server: Web app transfer = 24 minutes.
Production server: Webshare (no code) transfer = 12 sec
Development server using IP addressed assigned to server = 35 minutes
Development server using localhost as address = 12 sec
Launching request from Internet Explorer on Production server:
Production server: Web app transfer 6 sec
Production server: Webshare transfer 6 sec
Development server: Web app transfer 15 sec
Development server: Webshare transfer 15 sec
I told the network people that some thing is throttling the connection and that the code doesn't seem to put much of a performance penalty on the transfer. My users claim that this slow down just occurs in the last 2 weeks.
The network guys contended that on user to production server connection since the webshare speed is still good, it must be the codes. I think some things goes deeper than that because if the code is causing it then how come the same code run lightning fast on my development server that is just a lowly laptop.
I have an Asp.Net application that manages documents for my users. When an user asks for a file I send the file to the user using the follow code:
Dim fileStream As System.IO.Stream
Try
Dim fileBuffer(100000) As Byte
Dim fileLength As Integer
Dim dataToRead As Long
fileStream = New System.IO.FileStream(sTempFileName, System.IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
dataToRead = fileStream.Length
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=""" & dsDocFile.Tables("tbl_DocFile").Rows.Find(FileID). Item("FileName") & """")
While dataToRead > 0
If Response.IsClientConnected Then
fileLength = fileStream.Read(fileBuffer, 0, 100000)
Response.OutputStream.Write(fileBuffer, 0, fileLength)
Response.Flush()
ReDim fileBuffer(100000)
dataToRead = dataToRead - fileLength
Else
dataToRead = -1
End If
End While
Catch ex As Exception
Response.Write("Error: " & ex.Message)
Finally
If IsNothing(fileStream) = False Then
fileStream.Close()
End If
Response.Close()
End Try
Using the above method, the file transfer is more than 15-20 times slower than what I would get if I simply have a webshare to the same file. I expect some performance loss but should it be that much? Since webshare on a large scale is a big no no, I have to find out what causes the performance loss.
-
03-17-2008, 10:04 AM #2
RE: Web programmers' advice needed
try it as an FTP application:
http://forums.microsoft.com/MSDN/Sho...76638&SiteID=1
-
03-17-2008, 10:08 AM #3Member
- Join Date
- Sep 2004
- Location
- Louisiana, USA.
- Posts
- 7,431
RE: Web programmers' advice needed
In my intranet ftp is pretty much blocked. The corporate IT guys won't tell us why.
-
03-17-2008, 10:24 AM #4Member
- Join Date
- Sep 2004
- Location
- Sacramento, CA, USA.
- Posts
- 3,491
RE: Web programmers' advice needed
I personally wouldn't manually stream the file. Secure it with the code, sure, make everyone hit that authentication url to get the file they want but once they've been authenticated just redirect them to the file and let the web server do the file sending - i'll betcha it's LOTS faster.
-
03-17-2008, 12:01 PM #5Member
- Join Date
- Dec 1969
- Location
- Bradford, Vermont, MerryCanna.
- Posts
- 18,751
RE: Web programmers' advice needed
You would be STUNNED to see just how much overhead anything like ASP adds to any sort of processing. It's always best (fastest, most efficient) to do everything possible at the lowest level possible.
I'm still reeling from my discovery years ago that several of our products contain boolean OBJECTS with accessors. That adds something like a thousandfold clock ticks to every "machine-level" boolean.
-- Tim --
Member of the
Robert "Limey" Bolton Memorial
International
Volunteer Mentorship and Assistance
Programme
-
03-17-2008, 03:30 PM #6Member
- Join Date
- Sep 2004
- Location
- Louisiana, USA.
- Posts
- 7,431
RE: Web programmers' advice needed
>You would be STUNNED to see just how much overhead anything
>like ASP adds to any sort of processing. It's always best
>(fastest, most efficient) to do everything possible at the
>lowest level possible.
But but but Tim.... I can never code in assembly language. I've never had any IT training.
For me it is most expedient to do every thing at the highest level possible while still having acceptable performance.
-
03-17-2008, 03:34 PM #7Member
- Join Date
- Sep 2004
- Location
- Iowa CIty, Iowa, usa.
- Posts
- 1,989
RE: Web programmers' advice needed
I wish I could help you. Mostly because that would mean i have some idea of what you are talking about and I could get a better job :-)
Good luck though.
-
03-17-2008, 03:41 PM #8Member
- Join Date
- Sep 2004
- Location
- Louisiana, USA.
- Posts
- 7,431
RE: Web programmers' advice needed
Thanks Brent.
This stuff is really not so hard once you get into it. Only thing is that sometimes things are quite as visible so there's quite a bit of finger pointing.
-
03-17-2008, 04:23 PM #9Member
- Join Date
- Sep 2004
- Location
- Sacramento, CA, USA.
- Posts
- 3,491
RE: Web programmers' advice needed
Your IT guys have a bottleneck somewhere, I suspect. The streaming may be slowing things down, but I wouldn't bet that it'd be several orders of magnitude slower. I'd expect say 30-40% slower most of the time.
Tell 'em that it used to work fine and there were no code changes. That usually forces 'em to work on it :P
-
03-17-2008, 07:04 PM #10
RE: Web programmers' advice needed- the plot thickens.
I would look at the QOS settings on that server port. Is the app using some screwy TCP/UDP port?
Maybe a Duplex mismatch. Is that the only slow app on that port? Are other apps working as expected?
-tyler
*****************************
Tyler Scheel
Fremont, CA
http://www.escheel.com

Reply With Quote

Bookmarks