J
J.J.
Hi,
I've a quetion which has bugged me for quite a while.
I wrote a C#/.NET Web service which is hosted by IIS 5.1 on a Windows XP SP2
machine. This Web service just get the content of the specified txt file and
send the content back to the client. The processing time on the server side
was logged by IIS.
The file sizes and results are listed below (in millisecond):
FileSize: 1K 2K 4K 8K 16K 32K 64K 128K
256K
TimeUsed: 10.0 10.5 10.5 12.0 14.5 116.0 140.5 141
151
As you can seen, the weird thing is, when the file size changes from 16K to
32K, there is big jump in the processing time on the server side. Actually
the jump is between 30K and 31K: when file size is 30K, the time used on the
server side is about 15ms, when file size is 31K, it jumps to about 150ms
(this is the average value. In one of ten, the value is still very small,
like 10-20ms, but most of them are about 150-200ms).
And here is the code I used to implement the Web service:
public string GetLocalFile(string fileName)
{
string returnString = "";
string filePath = @"C:\Inetpub\wwwroot\Files\";
string fullName = filePath + fileName;
StreamReader fs = File.OpenText(fullName);
returnString = fs.ReadToEnd();
fs.Close();
return returnString;
}
I am using the following code on the client side to get files:
private void SendWsFileRequestOut()
{
long startTime, endTime, elapseTime;
startTime = DateTime.Now.Ticks;
//Call Web service for the specified file
fileFetcher.GetLocalFile(fileName);
endTime = DateTime.Now.Ticks;
elapseTime = endTime - startTime;
}
Can anyone help me figure out what the reason could be? Thanks a lot!
J.J.
I've a quetion which has bugged me for quite a while.
I wrote a C#/.NET Web service which is hosted by IIS 5.1 on a Windows XP SP2
machine. This Web service just get the content of the specified txt file and
send the content back to the client. The processing time on the server side
was logged by IIS.
The file sizes and results are listed below (in millisecond):
FileSize: 1K 2K 4K 8K 16K 32K 64K 128K
256K
TimeUsed: 10.0 10.5 10.5 12.0 14.5 116.0 140.5 141
151
As you can seen, the weird thing is, when the file size changes from 16K to
32K, there is big jump in the processing time on the server side. Actually
the jump is between 30K and 31K: when file size is 30K, the time used on the
server side is about 15ms, when file size is 31K, it jumps to about 150ms
(this is the average value. In one of ten, the value is still very small,
like 10-20ms, but most of them are about 150-200ms).
And here is the code I used to implement the Web service:
public string GetLocalFile(string fileName)
{
string returnString = "";
string filePath = @"C:\Inetpub\wwwroot\Files\";
string fullName = filePath + fileName;
StreamReader fs = File.OpenText(fullName);
returnString = fs.ReadToEnd();
fs.Close();
return returnString;
}
I am using the following code on the client side to get files:
private void SendWsFileRequestOut()
{
long startTime, endTime, elapseTime;
startTime = DateTime.Now.Ticks;
//Call Web service for the specified file
fileFetcher.GetLocalFile(fileName);
endTime = DateTime.Now.Ticks;
elapseTime = endTime - startTime;
}
Can anyone help me figure out what the reason could be? Thanks a lot!
J.J.