Strange web client or server behavior

Y

Yoav Ben-Ari

Hi,
I've come across I strange scenario which I can't explain... Please Help
!!!!

1) I created a simple web service on a server
2) I created a proxy to the web server using the wsdl.exe tool
3) I created a console application that calls a function in the webservice
via the proxy
1000 times with Thread.Sleep(50) between.

Now, when I run one instance of the process, I get about 20 hits per second
on my server (using perfmon) - not CPU bound and not network bound. So far
so good.
When running two instances of the process (from the same machine) I would
expect to get 40 hits per second - I get a bit less.
The problem starts here, as I increase the number of processes running the
client, the hits/second on the server don't increase beyond about 40. This
is also true if running the process from different computers.

If I duplicate the thread, rather than the process running the call - sleep
I do get a result which is the number of thread * 20 hits per second (i.e 5
threads would produce 100 hits per second).

Can anyone please tell me why I'm getting this behavior ?
Why don't multiple processes (even on different machines) give the same
result as multiple threads ?

Thanks,
Y.
 
H

Harald Ums

A multithreaded client only uses two socket connections to the server and multplexes requests, while each process uses it's own socket.
I can see your behaviour here when running a test between two xp machines but cannot reproduce it when using the loopback device on one machine.
So I suspect your server might be a microsoft client operating system as well. You might run in the connection limitation for ms clients when trying to use them as servers.

Harald
 
R

rwg

Yoav

That's an interesting test. I tried it on my machine, and had different results. For instance, I ran 4 copies and the service seemed to be running about 70
transactions a second. It didn't seem to matter much if I created the Web Service once per thousand iterations or created the web service 1000 times.
Creating the the web service only once resulted in about 4% increase in transactions per second.

I have a couple of questions ...

Which PerfMon counter are you using?

What do you mean by:
"If I duplicate the thread, rather than the process running the call - sleep"

For my test, I had a loop like this:

for ( int Idx = 0; Idx < 1000; Idx++ )
{
int A = rnd.Next( 10000 );
int B = rnd.Next( 10000 );
WSAdder.Service1 ws = new WSAdder.Service1();
int Rsp = ws.Add( A, B );
if ( !fSilentMode )
{
Console.WriteLine( A.ToString() + "+" + B.ToString() + "=" + Rsp.ToString() );
}
System.Threading.Thread.Sleep( 50 );
}

-rwg
This is what I think, not necessarily what is accurate!

--------------------
| From: "Yoav Ben-Ari" <[email protected]>
| Subject: Strange web client or server behavior
| Date: Sun, 4 Apr 2004 14:15:59 +0200
|
| Hi,
| I've come across I strange scenario which I can't explain... Please Help
| !!!!
|
| 1) I created a simple web service on a server
| 2) I created a proxy to the web server using the wsdl.exe tool
| 3) I created a console application that calls a function in the webservice
| via the proxy
| 1000 times with Thread.Sleep(50) between.
|
| Now, when I run one instance of the process, I get about 20 hits per second
| on my server (using perfmon) - not CPU bound and not network bound. So far
| so good.
| When running two instances of the process (from the same machine) I would
| expect to get 40 hits per second - I get a bit less.
| The problem starts here, as I increase the number of processes running the
| client, the hits/second on the server don't increase beyond about 40. This
| is also true if running the process from different computers.
|
| If I duplicate the thread, rather than the process running the call - sleep
| I do get a result which is the number of thread * 20 hits per second (i.e 5
| threads would produce 100 hits per second).
|
| Can anyone please tell me why I'm getting this behavior ?
| Why don't multiple processes (even on different machines) give the same
| result as multiple threads ?
|
| Thanks,
| Y.
|
|
|
 
Y

Yoav Ben-Ari

The client connection limit could be reached when running multiple processes
on the same
machine. However, when running say 5 copies on 5 different machines, it
can't be the client limit.


A multithreaded client only uses two socket connections to the server and
multplexes requests, while each process uses it's own socket.
I can see your behaviour here when running a test between two xp machines
but cannot reproduce it when using the loopback device on one machine.
So I suspect your server might be a microsoft client operating system as
well. You might run in the connection limitation for ms clients when trying
to use them as servers.

Harald
 
Y

Yoav Ben-Ari

Hi,

The creation of the web service proxy doesn't matter, and wasn't taken in
account.
Let me try to explain better.
The following is the code that calls the service:
protected static void bla() {

Service1 s1 = new Service1();

DateTime t = DateTime.Now;

for (int i=0; i<1000; i++)

{

s1.HelloWorld();

System.Threading.Thread.Sleep(50);

}

TimeSpan ts = DateTime.Now - t;

System.Console.WriteLine("Elapsed: " + (ts.Ticks /
TimeSpan.TicksPerMillisecond));

}

This function is wrapped in a thread an run. The difference in scenarios is
that in scenario 1 I create ONE thread that runs that function, and then
start up a few processes of that program (from several machines or from the
same machine, no difference detected) and in scenario 2 I create say 10
threads of the same function and start only one process of the program.

In the perfmon I'm looking at WebService.Post Requests / Sec







"rwg" said:
Yoav

That's an interesting test. I tried it on my machine, and had different
results. For instance, I ran 4 copies and the service seemed to be running
about 70
transactions a second. It didn't seem to matter much if I created the Web
Service once per thousand iterations or created the web service 1000 times.
 
H

Harald Ums

Yoav Ben-Ari said:
The client connection limit could be reached when running multiple processes
on the same
machine. However, when running say 5 copies on 5 different machines, it
can't be the client limit.
no, the limit is reached when connecting **TO** the same machine - this is the one enforcing the limit.
 
Y

Yoav Ben-Ari

That doesn't sound right to me since when running 3 processes, I would get 3
connections in
the server which can't be the limit


Yoav Ben-Ari said:
The client connection limit could be reached when running multiple processes
on the same
machine. However, when running say 5 copies on 5 different machines, it
can't be the client limit.
no, the limit is reached when connecting **TO** the same machine - this is
the one enforcing the limit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top