Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > WebService Method calls not paralellized??

Reply
Thread Tools

WebService Method calls not paralellized??

 
 
miha.valencic@gmail.com
Guest
Posts: n/a
 
      04-08-2005
Hi!

I've obveserved a strange fenomenon calling one webservice from a
multithreaded client. What I found out is, that the processing of the
client requests on the server side is not paralellized.

I have a sample WS with one method, int Add(int, int). the method just
adds first and second argument and returns the result.

The client is written in c# and starts n threads (i tested with 5, 10,
30) and invokes the service. The client also reports back the
Environment.TickCount after it finishes.

What happens is, that if the method call takes a long time (I've
embedded Thread.Sleep(5000) in it), the requests are processed really
funny. Like only two at a time are processed. It seems like only two
threads are processing client requests in IIS. I am using IIS on XP
pro, with .NET Framework 1.1.

If anyone has clues or ideas why that is so, I'd appreciate feedback.
Note that if there is no sleep(5000) in the WS Method call, or this is
minimal, the requests "seem" to be executed in parallel or are just so
fast.

The code (asmx, client) is available on
http://miha.magdalenice.net/temp/TestClientMain.zip -- compile with csc
*.cs.

Thanks,

Miha

 
Reply With Quote
 
 
 
 
Miha
Guest
Posts: n/a
 
      04-08-2005
More info on that:

Actually, not only that the request are not being paralelized, there is
a *gap* between each two requests. For instance, the WS method has
1000ms sleep in it. Which is evident between request 3 and request 4.
Two requests get executed concurently, or so it seems (1 and 2, 3 and
4, 5 and 6, and so on). And between these groups, there is 1000ms
gap-delay).

Is it possible that WinXP pro processes only 2 requests concurently????

Results output: (first is the thread ID, [t:number] is
Environment.TickCount. The Invoking Add operation is just before Invoke
is called (wsdl generated proxy code).

C:\work\dev\cs\WSTest>testclientmain
Starting @ 3049034
[1224] Invoking Add operation
Finished @ 3049064
[1136] Invoking Add operation
[2064] Invoking Add operation
[3216] Invoking Add operation
[3220] Invoking Add operation
[1732] Invoking Add operation
[2720] Invoking Add operation
[1792] Invoking Add operation
[2792] Invoking Add operation
[3120] Invoking Add operation
[1224] 1 + 2 = 3 [t:3050115]
[1136] 1 + 2 = 3 [t:3050125]
[2064] 1 + 2 = 3 [t:3051117]
[3216] 1 + 2 = 3 [t:3051127]
[3220] 1 + 2 = 3 [t:3052128]
[1732] 1 + 2 = 3 [t:3052138]
[2720] 1 + 2 = 3 [t:3053140]
[1792] 1 + 2 = 3 [t:3053150]
[2792] 1 + 2 = 3 [t:3054151]
[3120] 1 + 2 = 3 [t:3054161]

 
Reply With Quote
 
 
 
 
Miha
Guest
Posts: n/a
 
      04-08-2005
The previous comment referes to Cassini as a web server. Hosting asmx
in IIS, produces the following results:

C:\work\dev\cs\WSTest>testclientmain
Starting @ 3539459
Finished @ 3539459
[1352] Invoking Add operation
[2920] Invoking Add operation
[2756] Invoking Add operation
[2716] Invoking Add operation
[3536] Invoking Add operation
[4056] Invoking Add operation
[2628] Invoking Add operation
[2632] Invoking Add operation
[2748] Invoking Add operation
[1252] Invoking Add operation
[1352] 1 + 2 = 3 [t:3540621]
[2920] 1 + 2 = 3 [t:3540621]
[2716] 1 + 2 = 3 [t:3541612]
[2756] 1 + 2 = 3 [t:3541612]
[4056] 1 + 2 = 3 [t:3542614]
[3536] 1 + 2 = 3 [t:3542614]
[2632] 1 + 2 = 3 [t:3543615]
[2628] 1 + 2 = 3 [t:3543615]
[1252] 1 + 2 = 3 [t:3544616]
[2748] 1 + 2 = 3 [t:3544616]

 
Reply With Quote
 
Dilip Krishnan
Guest
Posts: n/a
 
      04-08-2005
Hello Miha,
I may be wrong here, but I think Wndow XP has a limitation that allows you
to open only 2 tcp connections to/from it at most. So its possible your client
is experiencing that limitation

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilip.krishnan at apdiya dot com


> Hi!
>
> I've obveserved a strange fenomenon calling one webservice from a
> multithreaded client. What I found out is, that the processing of the
> client requests on the server side is not paralellized.
>
> I have a sample WS with one method, int Add(int, int). the method just
> adds first and second argument and returns the result.
>
> The client is written in c# and starts n threads (i tested with 5, 10,
> 30) and invokes the service. The client also reports back the
> Environment.TickCount after it finishes.
>
> What happens is, that if the method call takes a long time (I've
> embedded Thread.Sleep(5000) in it), the requests are processed really
> funny. Like only two at a time are processed. It seems like only two
> threads are processing client requests in IIS. I am using IIS on XP
> pro, with .NET Framework 1.1.
>
> If anyone has clues or ideas why that is so, I'd appreciate feedback.
> Note that if there is no sleep(5000) in the WS Method call, or this is
> minimal, the requests "seem" to be executed in parallel or are just so
> fast.
>
> The code (asmx, client) is available on
> http://miha.magdalenice.net/temp/TestClientMain.zip -- compile with
> csc *.cs.
>
> Thanks,
>
> Miha
>



 
Reply With Quote
 
Miha
Guest
Posts: n/a
 
      04-08-2005
Dilip,

I was experimenting further and found that by increasing maxconnection
attribute value in macihne.config I was able to get past that.

What remains is a test with .net remoting (where my friend initially
found a problem).

So, this is not XP limitation (it would be a silly limitation ), it
is a configuration option for .net application (not for the whole
system).

Thanks for your input.

rgds,
Miha

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous Call of WebService method within a WebService RenÚ Preu▀ler ASP .Net Web Services 0 10-29-2008 11:55 AM
Voipdiscount Outgoing Calls with Sipgate Incoming Calls on a Linksys PAP2 Giganews UK VOIP 27 10-09-2006 11:28 PM
ods calls business object then method calls ta with output params andy6 ASP .Net 2 06-09-2006 01:54 AM
MoVoIP - FREE MOBILE Inetrnet Phone Calls - FREE Internet Phone Calls ubifone VOIP 0 07-29-2005 04:31 PM
Sequence of constructor calls and destructor calls. Honne Gowda A C++ 2 10-31-2003 09:31 AM



Advertisments