473,796 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asynchronous Socket Performance,

In my application the fowing call:

workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
AsyncCallback(S endMesCallBack) , 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 3843
By the way, can this problem be related to that this thing is going on
inside the asp.net process.

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

workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
AsyncCallback(S endMesCallBack) , 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.co m

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

workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
AsyncCallback(S endMesCallBack) , 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.Begi nSend 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.c om> wrote in
message news:ee******** *****@TK2MSFTNG P12.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.co m

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

workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
AsyncCallback(S endMesCallBack) , 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.co m

"Anders Both" <an********@hot mail.com> wrote in message
news:em******** ******@TK2MSFTN GP12.phx.gbl...
If I comment out the workSocket.Begi nSend 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.c om> wrote in message news:ee******** *****@TK2MSFTNG P12.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.co m

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

workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
AsyncCallback(S endMesCallBack) , 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.c om> wrote in
message news:#8******** ******@TK2MSFTN GP11.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.co m

"Anders Both" <an********@hot mail.com> wrote in message
news:em******** ******@TK2MSFTN GP12.phx.gbl...
If I comment out the workSocket.Begi nSend 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.c om> wrote in
message news:ee******** *****@TK2MSFTNG P12.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.co m

"Anders Both" <an********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> In my application the fowing call:
>
> workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
> AsyncCallback(S endMesCallBack) , 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.co m

"Anders Both" <an********@hot mail.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.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.c om> wrote in message news:#8******** ******@TK2MSFTN GP11.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.co m

"Anders Both" <an********@hot mail.com> wrote in message
news:em******** ******@TK2MSFTN GP12.phx.gbl...
If I comment out the workSocket.Begi nSend 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.c om> wrote
in
message news:ee******** *****@TK2MSFTNG P12.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.co m
>
> "Anders Both" <an********@hot mail.com> wrote in message
> news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > In my application the fowing call:
> >
> > workSocket.Begi nSend(byteData, 0, byteData.Length ,0, new
> > AsyncCallback(S endMesCallBack) , 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
431
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 life span so as soon as the code behind receives them it should render them as HTML while still listening for more messages.
5
5647
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 CancelIo(HANDLE hFile) method (declared in Winbase.h) in C++. Thanks for help. Olek
4
5435
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 server. Data is sent and received over these connections using the asynchronous model. The server is currently in beta testing. Sporadically over the course of the day, I'll observe the thread count on the process (via perfmon) start climbing....
9
8676
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 trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
5
6031
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" threads. I named the thread (see sample code below) in Accept callback started by BeginAccept but all connections accepted run in a thread that has the same name ! So, even a new thread is not started by BeginAccept, even my naming is
7
2389
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 what they were doing could take a look at my code and tell me where and why I'm going wrong. Any suggestions of groups or forums?
4
3822
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. I've read through what must be dozens of ways to do socket communication in C#, and it seems they all devolve into three basic options - Socket.Select, IOCP through a native interface, and Asynchronous callbacks. I'm fine using Asynchronous...
4
3606
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 client and asynchronous socket server example code provided in the .NET framework developers guide is a great start but I have not dealt with sockets before and I am struggling with something. From what I can tell the sample server code ...
2
3437
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 failing to asynchronously connect sockets on closed or filtered ports, but I'm quite unsure if this is a PHP issue or my misunderstanding, as it seems that socket streams only wrap around <sys/socket.h>.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.