PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Peter dot Collard at barclayscapital dot com
Subject: RE: Trying to cycle through ~150 Servers -ct_con_alloc failed
Date: Sep 27 2002 2:25PM

Try 'netstat -a' and you may see a whole load of old connections in
something like FIN_WAIT_2 or TIME_WAIT . This is a tcp issue (which you can
fix on Sun with ndd) where the old connections are held before recycling the
network slot.

__________________________________________________

Regards
Peter Collard
Sybase DBA
020777-33457

__________________________________________________


-----Original Message-----
From: Michael Peppler [mailto:mpeppler@peppler.org]
Sent: 13 September 2002 15:20
To: SybPerl Discussion List
Subject: Re: Trying to cycle through ~150 Servers -ct_con_alloc failed


My guess is that the connection doesn't get cleaned up correctly.

Try enabling the full trace (via Sybase::CTlib::debug(0xffffffff)) and
see whether the connection gets cleaned up correctly.

Michael


On Thu, 2002-09-12 at 09:08, Rybacki, Jim wrote:
> I could use some help here.
> 
> Specifics:
> 	OS        : HP/UX 11.0
> 	Perl       : 5.005_03
> 	Sybperl  :sybperl-2.14
> 	CT-LIB   : Sybase Client-Library/11.1.1/P-EBF8061
> 	Sybase  : 11.0.0.3 -> 11.9.2
> 
> The problem:
> 	I'm trying to cycle through approximately 150 Sybase
> 	servers on seperate machines in order collect information.
> 	After about 4 interations of the server loop I receive the 
> 	following error:
> 		ct_con_alloc failed at Server.pm line 69.
> 
> 	Server.pm  (code snippet)
> 
> 	In an attemp to catch the sybase warning (?)  for 'connection to two
> endpoints failed'
> 	I placed the following in my callback procedure and try to catch it
> with an eval on the
> 	new (ct_connect) command. 
> 
> 	Server.pm 
> 		Callback routine:
> 		...
> 		if ( $severity = 5 && $number=3 ){
>          			die "Server unreachable\n";
> 		}
> 
> 		Repos new (server object)
>             	
> Line 69		eval { local $SIG{'__DIE__'} ; $dbh = new
Sybase::CTlib
> $user, $PWD , $server_name, $appname } ; 
>  		if ( $@ || ! defined ($dbh) ) {
>       			print "a=$@\n";
>       			return (0);
>  		}	
> 	 	$obj = {  _dbh => $dbh,          # Database Handle
>                    		_user => $user,        # User name
>                		_name => $server_name };    # Server name

> 		bless $obj;
> 		return ($obj)
> 
> 	Server.pm (end)
> 
> 	ping.pl
> 
> 		@servers=get_server_list();
> 		foreach (@servers){
> 			$Server=$Repos->new(......);
> 			if ( ! $Server ){
> 				..... } update server down state
> 			else {
> 				Repos->close($Server)      ( which does a
> CT_CLOSE on the dbh - does this work?).
> 			}
> 	ping.pl (end)
> 
> The UNIX box has 20GB of memory so I don't this is a memory problem (per
> CTLIb man). I've
> looked at the CTLIb.c code, RTFM, and tried many combos of this -to no
> avail. 
> I was under the impression that once a dbh goes out of scope that the
> resources 
> are released.(??)
> 
> Anyway, I would really like to get loop this to work (not just for a
ping).
> 
> Does anyone have a suggestion ?
> 
> Thanks in advance,
> Jim Rybacki
> Citistreet
> Sybase DBA
> Ph:   904.791.2900
> Fax: 904.791-2169
> E-Mail: jrybacki@citistreetonline.com
> 
-- 
Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!


------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.


Internet communications are not secure and therefore the Barclays 
Group does not accept legal responsibility for the contents of this 
message.  Although the Barclays Group operates anti-virus programmes, 
it does not accept responsibility for any damage whatsoever that is 
caused by viruses being passed.  Any views or opinions presented are 
solely those of the author and do not necessarily represent those of the 
Barclays Group.  Replies to this email may be monitored by the Barclays 
Group for operational or business reasons.

------------------------------------------------------------------------