Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: UDP buffer problems

www.cryer.info
Managed Newsgroup Archive

Re: UDP buffer problems

Subject:Re: UDP buffer problems
Posted by:"Martin James" (mjames_falc..@dial.pipex.com)
Date:Thu, 22 Jun 2006 13:02:05

>
> I have tried with setsockopt and it works better, but it is true that I am
only delaying the problems, so I will try to use a different thread to
proces them.
>

The overall throughput improvement available by multiThreading depends upon
the number of processors available and how much 'slack' is available from
the DB operations.  If there is more than one processor available, or if the
DB operations block at all, (which they frequently do because of disk
operations), then you can expect a good increase in performance even without
any extra 'tricks'.

If the DB is just unable to to perform its queries/updates faster than the
datagrams are coming in, you will have a problem no matter how you design
your app.  Instead of the datagrams being lost in Winsock, the data will
accumulate in user-space buffers until either memory runs out, your
inter-thread comms object pool runs out or some other resource empties.

You may have to look carefully at your SQL/whatever to optimize the way
updates are applied.   Having a queueful of datagrams makes it easier to
apply updates in batches and so improve DB bandwidth. Also there are stored
procedures etc. that you could use.

Rgds,
Martin

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive