🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4664

Re: Server Socket Problem

#4664
From: Patrick Wong
Date: Thu, 13 Jan 2005 01:56
97 lines
5616 bytes
Thanks to all.  Didn't expect so many zealous response.  I reply here to you
all in general.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:41e56c4a$1@newsgroups.borland.com...
>
> You are overloading your server will too many requests at a time.  The
> server can accept only so many connections at a time.  Any connections
that
> cannot be queued for acceptance will return a 10061 error.
>
The server creates a new thread to accept a client connection.  From the log
file I can see processing is very smooth.  The rate of client requests does
not differ from the begin of test to the time that error occurs.  If the
server is overloaded, it should be not accepting at the very beginning, but
not after an hour.  Is this a reasonable guess?
Now, by "The server can accept only so many connections at a time", how many
connections then?  Is this a tunable parameter elsewhere?  Someone from the
ICS user group told that can be a registry setting.

"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:ettau0t9ik8a1g2hk39pqsthfuu607810l@4ax.com...
>
> If this takes an hour to manifest, (one assumes the test program is
> somewhat consistant in tests per second), does it mean the server is
> being a bit slow to release "disconnected" sessions?
>
The accepted client connections are released immediately when the client
disconnected.  From the log file I see the processing was still smooth at
the time error occurred.

> Or otherwise running out of resources that aren't getting reclaimed in a
timely manner?
That are what I want to trace.  I saw the memory usage, CPU time was not
monopolized by the application when that was problem.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:41e580e5$1@newsgroups.borland.com...
>
> The error has to do with the numer of pending queued connections, not the
> number of established connections.  When a client connects to a server,
the
> connection is placed into a queue.  When the server calls accept(), a
> connection is removed from the queue.  When the server begins listening,
it
> specifies the maximum number of connections can are allowed to be queued
at
> a time.  If the maximum number of clients are already queued, any further
> clients will fail to connect until the queue opens up available slots.
>
What is the maximum number of requests that is allowed to queue?  Again, is
it a system parameter or depends on the socket implementation?  At the time
when problem occurred, requesting clients were blocked for more than five
minutes.  I also failed simple telneting to the server listen port.  How to
distinguish whether a request is queued waiting to be accepted, is not
allowed to queue, or the server is not listening indeed?

"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:8o3bu0trq4744vmuh3uft6g6a3bo14i9m6@4ax.com...
>
> So then the OP's server is just a tad slower than his testing client,
> such that over the course of say, a second, the server falls behind by
> one connection/accept. So after an hour of the que getting deeper and
> deeper, it finaly fills up.
> IOW if the server can accept/process 100 connections per second, and
> the tester sends out 101....
> Or if the server pauses for garbage collection, or Windows disk flush,
> and falls behind....
>
As said, each accept connection is processed by a created thread.  Threads
are created and terminated
in a timely fashion as indicated in the log file.

> If this is data gathering, maybe the client could increase the packet
> size on the next connection after a failure.
>
I don't seem to have reason to ask the client to change it sending behavior.
At the server side I want to cater the best and the worst scenarios.  There
can be only one client sending an extremely long packet in one hour, or can
be many many cleints sending very short burst simultaneously all in a
sudden.

"Hans Galema" <notused@notused.nl> wrote in message
news:41e5a18c$1@newsgroups.borland.com...
> But if at that moment the client halted with trying to make
> new connections, the server could recover. And then after some minutes
> the client should be able to continue.
>
I observed requesting clients were blocked for more than five minutes, will
it take that long for the server socket to recover?

I hope I explained my problem clear enough.  I want to trace the reason of
problem at the first place.  Are there any tools that can help?  I don't
have equipment like network analyzer here.

Regards,
Patrick
Technical Details
Message-ID: <41e5d556@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41e50bd0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,9670bce8fe2a64d1
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Patrick Wong" <patrickwong@computer.org>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41e50bd0@newsgroups.borland.com>
Subject: Re: Server Socket Problem
Date: Thu, 13 Jan 2005 09:56:38 +0800
Lines: 99
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 203.82.252.252
Message-ID: <41e5d556@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1105581398 203.82.252.252 (12 Jan 2005 17:56:38 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail