[freetds] Plagued by random "Connection Refused"

Andy Cranston a.cranston at selwaymoore.com
Tue Apr 27 03:46:31 EDT 2004


Another thought I've had is that maybe it isn't to do with the number of
concurrent connections that can/should be supported.  Perhaps it is to do
with the initial "mini-flood" of connection requests happening very close
together?

I'd be interested to hear what sort of machines are involved both at the
FreeTDS end and at the SQL Server end.  A poorly implemented TCP/IP stack in
either machine could be the cause - especially if one machine is
significantly faster than the other.

I've seen a similar problem using standard FTP (although this was *quite* a
while ago).  I was running a *huge* automated ftp script on a RS/6000 box to
get a whole file systems worth of files from a MicroVAX.  Initial tests
showed that roughly 1% of the gets failed.  The problem was that the
MicroVAX simply could not keep up.  The "solution" to the problem was to put
a sleep of one second between each get.  This more than doubled the runtime
but as it was a one off (an application migration) I lived with it.

Regards,

Andy Cranston.

-----Original Message-----
From: warhau [mailto:warhau at austin.rr.com]
Sent: 27 April 2004 08:44
To: 'FreeTDS Development Group'
Subject: RE: [freetds] Plagued by random "Connection Refused"


Thanks. My SQL server is supposed to be able to handle 32K connections by
default, isn't it? 

Scripts shouldn't overlapping because I have some detection code to note
that the previous one is running. Question though, should it matter if cron
does overlap the processes as far as TDS is concerned? I would think that
each run time of the script would get a separate copy of all the database
stuff. It obviously wouldn't be nice to have 4 versions of the same script
doing the same work at the same time, but would it cause "connection
refused"? 

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Andy Cranston
Sent: Tuesday, April 27, 2004 2:26 AM
To: 'FreeTDS Development Group'
Subject: RE: [freetds] Plagued by random "Connection Refused"

If your cron processes start to take 60 seconds or more to complete then
cron will start to overlap the processes.  This could be one source of the
problem.

Another issue might be the number of concurrent connection requests the
server can handle.  Instead of having twelve seperate cron entries running
every minute (that is my understanding of your config - if not could you
post a copy of your crontab file) have one entry that calls a shell script
to call each of the twelve processes in sequence.  Process two only starts
when process one has completed, process three only starts when process two
has completed etc.  You could also add a check to see if the previous
invocation 60 seconds ago is still running.  You may want this minutes
invocation to skip when this happens.

Just some ideas.  Hope this helps.

Regards,

Andy Cranston.

-----Original Message-----
From: warhau [mailto:warhau at austin.rr.com]
Sent: 27 April 2004 06:32
To: FreeTDS at lists.ibiblio.org
Subject: [freetds] Plagued by random "Connection Refused"


I am running 12 separate cron processes per minute which all connect to the
same db to do different things. Unreproducably, but regularly, I get

 

src/tds/login.c: tds_connect: 172.31.132.34:5197: Connection refused

OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server myserver, database Message String: Server is unavailable or does not
exist.

 

 

The rest of the processes normally succeed without a problem. Some times
there are 5 out of 12 of these failures in one minute. Some times there is
30 minutes in between. 

 

Specs below. Any help on how to troubleshoot this is much appreciated.

 

 

FreeTDS and db machine are in the same rack on the same subnet. 

No load on db.

Db freshly rebooted. 

Separate interface in machine tried with separate route port, cable, etc.
with same effect

 

FreeTDS version 0.61.2

MSSQL 2000

DBI 1.42

DBD-Sybase 1.02

 

Actual connect code which prints the error above

 

-----

 

my (%config);

use DBI;

            

$ENV{SYBASE} = "/usr/local/etc/";         

 

$config{'dbdriver'} = "Sybase";

$config{'dbserver'} = "myserver";

$config{'dbuser'} = "myuser";

$config{'dbpass'} = "mypass";

 

my $dbh = DBI->connect("dbi:$config{'dbdriver'}:server=$config{'dbserver'}",
$config{'dbuser'}, $config{'dbpass'}, {PrintError => 0}) 

            or print $DBI::errstr;

 

$dbh->{'Warn'} = 0;

 

------ 

_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

________________________________________________________________________
This message has been checked for all known viruses by the Selway Moore
scanning service powered by MessageLabs. For further information and
statistics on current viruses visit http://www.messagelabs.com/stats.asp
________________________________________________________________________

________________________________________________________________________
This message has been checked for all known viruses by the Selway Moore
scanning service powered by MessageLabs. For further information and
statistics on current viruses visit http://www.messagelabs.com/stats.asp
________________________________________________________________________
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

________________________________________________________________________
This message has been checked for all known viruses by the Selway Moore
scanning service powered by MessageLabs. For further information and
statistics on current viruses visit http://www.messagelabs.com/stats.asp
________________________________________________________________________

________________________________________________________________________
This message has been checked for all known viruses by the Selway Moore
scanning service powered by MessageLabs. For further information and
statistics on current viruses visit http://www.messagelabs.com/stats.asp
________________________________________________________________________



More information about the FreeTDS mailing list