From: Manish on
Hello !

We are developing a GPRS Connection GateWay Server. The Clients (remote
devices) wil get connected to this Server and we are expecting about 50,000
to 100000 such connections within 30 min duration. The peak Load or
concurrent load we are expecting is about 10,000 to 30,000 socket
connections. And each socket session (collecting Data from remote device)
lasting for about 10 to 60 seconds ,in this communcation around 25 commands
to the device are sent and for each command the device will reply.

We have chosen Asynchronous Socket I/O (with call back function i.e.
BeginReceive(...) and BeginSend(....)) programming modal for server
development.

We have follwing queries

Q1. How it will be possible to handle 10,000 to 30,000 Sockets at a time by
ThreadPool Threads ?
Q2.What should we keep the MaxThread value (i.e. in threadpool) i.e.
SetMaxThread and MinThreadValue i.e. SetMinThread ?
Q3.How can we see how many threads are under use from threadpool (This is
not reflected in TaskManager) ?
Q4.How to set Connection ,Read and Write Time outs of the socket?

Waiting for your reply

Regards
Manish




From: Peter Duniho on
Manish wrote:
> Hello !
>
> We are developing a GPRS Connection GateWay Server. The Clients (remote
> devices) wil get connected to this Server and we are expecting about 50,000
> to 100000 such connections within 30 min duration. The peak Load or
> concurrent load we are expecting is about 10,000 to 30,000 socket
> connections. And each socket session (collecting Data from remote device)
> lasting for about 10 to 60 seconds ,in this communcation around 25 commands
> to the device are sent and for each command the device will reply.

The math above seems a bit suspect to me. If your total number of
connections is only 100,000 over a 30 minute time period, and each
connection will last at most 60 seconds, then a peak concurrent load of
as little as 10,000 implies that the server will be nearly idle for most
of the rest of the 30 minute period (a higher peak concurrent load
implies an even longer amount of idle time).

But even if your client traffic is so "peaky", it should be fine.

> We have chosen Asynchronous Socket I/O (with call back function i.e.
> BeginReceive(...) and BeginSend(....)) programming modal for server
> development.
>
> We have follwing queries
>
> Q1. How it will be possible to handle 10,000 to 30,000 Sockets at a time by
> ThreadPool Threads ?

..NET uses a dedicated thread pool group for IOCP, which in turn is used
by the Socket class when you use the asynchronous model. IOCP is very
good at managing large numbers of sockets (in fact, while the IOCP
thread pool is allowed to get very large, in practice you really only
need roughly the same number of IOCP threads as CPU cores for best
performance).

> Q2.What should we keep the MaxThread value (i.e. in threadpool) i.e.
> SetMaxThread and MinThreadValue i.e. SetMinThread ?

Don't touch the thread pool count values. If and when you have enough
experience with .NET Sockets and IOCP that you could answer all of the
other questions in your post yourself, then you can start experimenting
with changing the thread pool parameters. Until then, you're better off
sticking with the defaults Microsoft has provided.

> Q3.How can we see how many threads are under use from threadpool (This is
> not reflected in TaskManager) ?

I don't recall, but it's possible the VS profiler or other profiling
tools will track that data for you. Alternatively, you can call
GetAvailableThreads() and GetMaxThreads() and comparing the two; that
difference will tell you the number of active threads, i.e. those that
are actually running and committed to your code (either processing or
blocking on i/o).

> Q4.How to set Connection ,Read and Write Time outs of the socket?

Not sure why you want to set a connection time-out on a server.
Read/write timeouts can be set using Socket properties.

Pete
From: Thomas Scheidegger on
> We have chosen Asynchronous Socket I/O

read:
Significantly improved performance and scalability
of the System.Net.Sockets class in the .NET Framework 3.5:
http://msdn.microsoft.com/en-us/magazine/cc163356.aspx


--
Thomas Scheidegger - 'NETMaster'
http://dnetmaster.net/

 | 
Pages: 1
Prev: about some drawing
Next: interface?!