Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: Support a large amount of clients and lower CPU cost?

www.cryer.info
Managed Newsgroup Archive

Re: Support a large amount of clients and lower CPU cost?

Subject:Re: Support a large amount of clients and lower CPU cost?
Posted by:"Mike Williams (TeamB)" (mlwi!!ia..@gmail!.com)
Date:1 Nov 2007 09:11:52

H Visli wrote:

> I'm writing a Socket server(TCP). I use long connection between
> server and clients, the frequency of data transmission is up to 1-2
> seconds. I develop under Synapse library, use a thread to monitor the
> connection request of the client,  and create a corresponding thread
> for each client.  Now test results is: If there are 200 clients, the
> server's CPU utilization rate will be around 40%!

I'd try to identify where the server is spending its time.  40% may be
perfectly reasonable for 200 clients.  On the other hand, your
monitoring thread(s) may be eating up many CPU cycles in a tight loop.
Without profiling your code to know exactly what it's doing it's not
really possible to make it better unless you make some lucky guesses.

--
-Mike (TeamB)

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive