[freetds] Logging Max connections reached, increase value of TDS_MAX_CONN

Jose Santiago Oyervides Gonzalez jose.oyervides at elnorte.com
Thu Apr 15 14:44:54 EDT 2004

Hi all,
It seems I have a situation with the connections of freetds with mssql 2k.

My apache error log is logging: "Max connections reached, increase value of
TDS_MAX_CONN", after several messagges the apache stops responding.

The apache server connects with MSSQL 2K, it has freetds 0.61.2, in my
global section I have "tds version = 7.0", all defaults, and this:

host = <ApacheServerIP>
port = 1443
tds version = 7.0

I Changed my pool.conf like this:
        min pool conn = 5
        max pool conn = 300
        max member age = 120

I have an application which connects with my apache server and generates
files to an intranet, this application makes connections with my apache
server to certain php pages and creates files (which later are shown in one
intranet), these php pages connects with MSSQL, (using freetds of course),
my application uses 90 threads simultaneously to connect with my server.
This application runs every hour for 15 minutes approx.

The apache seems to work fine at first, but from time to time, it starts to
logging "Max connections reached, increase value of TDS_MAX_CONN", I noticed
yesterday that after a lot of this messages my apache stopped responding. (I
had to reboot the server).

I've searched the forums for someone having the same problem and it seems
nobody has had this kind of problems. I know now that I would have to change
the value of this parameter in the source files and recompile (or I think

The default value is 4096 and I'm thinking to change it to 8192.

Does anyone know what repercussions would have this change?
Am I right about the procedure (Change the value and recompile)?  Is it
Is there a way I can realize how many connections (of freetds) has the
server?  (The apache server-status shows no active connections when it
Is there a way I can "kill" the connections after the pages generations end?

I really look forward for your comments.

Jose Oyervides.

More information about the FreeTDS mailing list