![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#11
| |||
| |||
|
|
hmm.. im not really familiar with the readtoend() method but something else my be creating unnecessary allocations. try setting the initial string returnString = null; you might also want to try something like this to avoid the string allocation. try{ open file here return fs.ReadToEnd(); }finally{ fs.close(); } if this code is really important, you may want to hold the file in memory. there are alot if factors that come into play when you are doing IO in this manner that may be out of your immediate control. i wouldnt go any further without caching this file.. is that an option? |
#12
| |||
| |||
|
|
I would try benchmarking the file operation itself separately, it seems likely to me that the overhead is in the webservice stuff, not in the reading of the file. Maybe IIS handles large responses from webservices (seems to be >= 32K, the 30KB response string + headers) differently. Just guessing. But 100ms would be too much even for 1MB, and not 30KB. .... |
#13
| |||
| |||
|
|
.... (Round Trip Time). Some info is on: |
#14
| |||
| |||
|
|
"Stefan Simek" <simek.nospam (AT) triaxis (DOT) nospam.sk> wrote in message news:O8uuJQ$AGHA.3064 (AT) TK2MSFTNGP10 (DOT) phx.gbl... .... I would try benchmarking the file operation itself separately, it seems likely to me that the overhead is in the webservice stuff, not in the reading of the file. Maybe IIS handles large responses from webservices (seems to be >= 32K, the 30KB response string + headers) differently. Just guessing. But 100ms would be too much even for 1MB, and not 30KB. .... Yes, just now I realized that OP measures time at the *client*, not the server. Even without IIS, sending larger amout of data over socket would require round trips. This is tricky to exactly calculate, it would depend on max. window size, congestion avoidance algorithm used etc. For example, if you send 16K, it may fit in initial window, so is transmitted without much delay. However, sending more may require waiting for other side to acknowledge the data (to open TCP send window). Since fast networks are more limited by latency than throughput, I would expect such behaviour. It should stabilize at large file sizes, if TCP window is big enaugh (TCP big window option enabled). Rule of thumb is that window size must be > bandwith * RTT (Round Trip Time). Some info is on: Regards, Goran |
#15
| |||
| |||
|
#16
| |||
| |||
|
|
Hi all, Thank you very much for your help! Actually, if you look into my original post, you will see 90% measurements for 32K file are greater than 100ms, but there are still some of them (10%) are just 10-20ms. Can we use max. sending window size to explain this? Also, do you know if there is a way to change the initial window size? (Is this part of TCP protocol itself?) .... |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |