[Mono-bugs] [Bug 474217] Creating a remoting connection takes very long when a large number of clients connect simultaneously

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Dec 15 13:37:57 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=474217

https://bugzilla.novell.com/show_bug.cgi?id=474217#c11


--- Comment #11 from Gonzalo Paniagua Javier <gonzalo at novell.com> 2010-12-15 18:37:55 UTC ---
Lluis, being able to handle thousands of connections does not require hitting
any threadpool limits. For instance, a simple httplistener test can serve ~9k
simple responses per second using just 2 threads.

The problem is how the code deals with operations that should be asynchronous.
I haven't looked recently, but there's probably stuff like:
-socket.Receive()
-socket.Send()

Or:
-socket.BeginReceive() / Wait / socket.EndReceive

Instead of:
  socket.BeginReceive (.....OnReceiveCB, socket....);
  void OnReceiveCB (...)
  {
        ...
        socket.EndReceive(...)
        ...
        // call socket.BeginReceive() again if needed
  }


If you use the first 2 cases, it will eventually hit some limit (btw, the
threadpool code, unlike the TCP remoting server, has improved quite a bit over
the years). If you use something like the second case, there won't be any
thread wasted waiting for I/O.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list