473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Asynchronous Socket Performance,

In my application the fowing call:

workSocket.BeginSend(byteData, 0, byteData.Length,0, new
AsyncCallback(SendMesCallBack), null);

Takes between 156250 and 312500 Ticks . And when like 20 calls are made at a
time, they really sum up to something that I did not exspect att all.
Why does I exspirence this thing, is this normal ?
(I am 100% sure that the time is consumed by only this single line)

?
Nov 15 '05 #1
6 3817
By the way, can this problem be related to that this thing is going on
inside the asp.net process.

"Anders Both" <an********@hotmail.com> wrote in message
news:#Q**************@TK2MSFTNGP09.phx.gbl...
In my application the fowing call:

workSocket.BeginSend(byteData, 0, byteData.Length,0, new
AsyncCallback(SendMesCallBack), null);

Takes between 156250 and 312500 Ticks . And when like 20 calls are made at a time, they really sum up to something that I did not exspect att all.
Why does I exspirence this thing, is this normal ?
(I am 100% sure that the time is consumed by only this single line)

?

Nov 15 '05 #2
Anders,

My guess is that it has something to do with the IO completion ports
that are allowed for the machine. I'm guessing that with ASP.NET using up
some threads in the thread pool for IO completion ports, as well as the
Socket class (which makes calls to WSARecv using IO completion ports, I
believe), you might be running low on resources.

I am curious, have you tried the numbers without using sockets
asynchronously?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
In my application the fowing call:

workSocket.BeginSend(byteData, 0, byteData.Length,0, new
AsyncCallback(SendMesCallBack), null);

Takes between 156250 and 312500 Ticks . And when like 20 calls are made at a time, they really sum up to something that I did not exspect att all.
Why does I exspirence this thing, is this normal ?
(I am 100% sure that the time is consumed by only this single line)

?

Nov 15 '05 #3
If I comment out the workSocket.BeginSend part, there is no performance
problems at all. Then all numbers are just around 0 Ticks.

It is strange, I am lokking into it, right now. And will be contenniung
tuesday. More good idea and advice are wery welcome.

Best Regards.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ee*************@TK2MSFTNGP12.phx.gbl...
Anders,

My guess is that it has something to do with the IO completion ports
that are allowed for the machine. I'm guessing that with ASP.NET using up
some threads in the thread pool for IO completion ports, as well as the
Socket class (which makes calls to WSARecv using IO completion ports, I
believe), you might be running low on resources.

I am curious, have you tried the numbers without using sockets
asynchronously?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
In my application the fowing call:

workSocket.BeginSend(byteData, 0, byteData.Length,0, new
AsyncCallback(SendMesCallBack), null);

Takes between 156250 and 312500 Ticks . And when like 20 calls are made
at a
time, they really sum up to something that I did not exspect att all.
Why does I exspirence this thing, is this normal ?
(I am 100% sure that the time is consumed by only this single line)

?


Nov 15 '05 #4
Anders,

I think you misunderstood. Instead of making a asynchronous call, how
is the performance if you make a synchronous call?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
If I comment out the workSocket.BeginSend part, there is no performance
problems at all. Then all numbers are just around 0 Ticks.

It is strange, I am lokking into it, right now. And will be contenniung
tuesday. More good idea and advice are wery welcome.

Best Regards.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ee*************@TK2MSFTNGP12.phx.gbl...
Anders,

My guess is that it has something to do with the IO completion ports
that are allowed for the machine. I'm guessing that with ASP.NET using up some threads in the thread pool for IO completion ports, as well as the
Socket class (which makes calls to WSARecv using IO completion ports, I
believe), you might be running low on resources.

I am curious, have you tried the numbers without using sockets
asynchronously?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
In my application the fowing call:

workSocket.BeginSend(byteData, 0, byteData.Length,0, new
AsyncCallback(SendMesCallBack), null);

Takes between 156250 and 312500 Ticks . And when like 20 calls are
made at
a
time, they really sum up to something that I did not exspect att all.
Why does I exspirence this thing, is this normal ?
(I am 100% sure that the time is consumed by only this single line)

?



Nov 15 '05 #5
I dont know that. But it would be a bit of work to change my server socket
into a synchronous socket, just to try it.

But but but, the latest news is that if I set:

Optimize Code to true,
and
run the project without debuging (in release mode),
(maybe this is the thing and the optimize code does not matter)

stuff seems to be much much much much better. But I am not still sure that
the problem is solved 100%.

I will come back here Thursday, (I cannot spell thesse days in English)

Best Regards. Anders Both, Denmark

If i set

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:#8**************@TK2MSFTNGP11.phx.gbl...
Anders,

I think you misunderstood. Instead of making a asynchronous call, how
is the performance if you make a synchronous call?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
If I comment out the workSocket.BeginSend part, there is no performance
problems at all. Then all numbers are just around 0 Ticks.

It is strange, I am lokking into it, right now. And will be contenniung
tuesday. More good idea and advice are wery welcome.

Best Regards.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ee*************@TK2MSFTNGP12.phx.gbl...
Anders,

My guess is that it has something to do with the IO completion ports that are allowed for the machine. I'm guessing that with ASP.NET using up
some threads in the thread pool for IO completion ports, as well as

the Socket class (which makes calls to WSARecv using IO completion ports, I believe), you might be running low on resources.

I am curious, have you tried the numbers without using sockets
asynchronously?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> In my application the fowing call:
>
> workSocket.BeginSend(byteData, 0, byteData.Length,0, new
> AsyncCallback(SendMesCallBack), null);
>
> Takes between 156250 and 312500 Ticks . And when like 20 calls are

made
at
a
> time, they really sum up to something that I did not exspect att all. > Why does I exspirence this thing, is this normal ?
> (I am 100% sure that the time is consumed by only this single line)
>
> ?
>
>



Nov 15 '05 #6
Anders,
That will generally be a good idea. Generally speaking, you are going
to get better performance numbers if you are running code without debug
symbols in it.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I dont know that. But it would be a bit of work to change my server socket
into a synchronous socket, just to try it.

But but but, the latest news is that if I set:

Optimize Code to true,
and
run the project without debuging (in release mode),
(maybe this is the thing and the optimize code does not matter)

stuff seems to be much much much much better. But I am not still sure that
the problem is solved 100%.

I will come back here Thursday, (I cannot spell thesse days in English)

Best Regards. Anders Both, Denmark

If i set

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:#8**************@TK2MSFTNGP11.phx.gbl...
Anders,

I think you misunderstood. Instead of making a asynchronous call, how
is the performance if you make a synchronous call?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Anders Both" <an********@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
If I comment out the workSocket.BeginSend part, there is no performance problems at all. Then all numbers are just around 0 Ticks.

It is strange, I am lokking into it, right now. And will be contenniung tuesday. More good idea and advice are wery welcome.

Best Regards.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:ee*************@TK2MSFTNGP12.phx.gbl...
> Anders,
>
> My guess is that it has something to do with the IO completion
ports > that are allowed for the machine. I'm guessing that with ASP.NET using
up
> some threads in the thread pool for IO completion ports, as well as

the > Socket class (which makes calls to WSARecv using IO completion
ports, I > believe), you might be running low on resources.
>
> I am curious, have you tried the numbers without using sockets
> asynchronously?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Anders Both" <an********@hotmail.com> wrote in message
> news:%2****************@TK2MSFTNGP09.phx.gbl...
> > In my application the fowing call:
> >
> > workSocket.BeginSend(byteData, 0, byteData.Length,0, new
> > AsyncCallback(SendMesCallBack), null);
> >
> > Takes between 156250 and 312500 Ticks . And when like 20 calls are

made
at
> a
> > time, they really sum up to something that I did not exspect att all. > > Why does I exspirence this thing, is this normal ?
> > (I am 100% sure that the time is consumed by only this single

line) > >
> > ?
> >
> >
>
>



Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam | last post by:
Hi, I'm trying to build a client ASP.NET application in VB.NET that can display messages from a server application as soon as it receives them. These messages from the server have a limited...
5
by: a.kostrzewa | last post by:
I have a question about C#. How can I stop asynchronous read/write operation ( BeginReceive() / BeginSend() ) if timeout occurs? The Socket class doesn't make any cancel method available. I used...
4
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
9
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
5
by: Droopy Toon | last post by:
Hi, I am using asynchronous socket (BeginAccept for example). I tried to name each thread I am using but threads created by asynchronous Socket functions (like BeginAccept) creates "anonymous"...
7
by: Colin | last post by:
I'm writing a little console socket server but I'm having some difficulty. Can I ask your advice - where is the best place to get some help on that topic? It would be nice if some people who knew...
4
by: taskswap | last post by:
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. ...
4
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket...
2
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.