Re: SV: SV: mssql tcp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jocke,

Well asuming that your problems are associated with msdblib. I'm using
msdblib too without any tcp problems so it could also be something else on
your system. This is a simple fix and it will work without changing code or
switching away from ISAPI. You might want to read this article
http://kromann.info/article.php?Id=11062598797760000

- Frank


> Hi
> 
> Interesting, so if I swap mssql library to FreeTDS (never heard of this
before) my socket problem will disappear without changing the code?
> 
> Do I have to change from ISAPI (IIS6) to CGI?
> 
> // jocke
> 
> 
> -----Ursprungligt meddelande-----
> Från: Frank M. Kromann [mailto:frank@xxxxxxxxxxxx] 
> Skickat: den 15 november 2005 17:23
> Till: Joakim Ling
> Kopia: php windows; Robert Twitty
> Ämne: Re: SV:  mssql tcp
> 
> Hi Jocke,
> 
> Well I work with PHP and MSSQL and I know a bit about the broblems too.
> The library used to build the extension (msdblib) is not thread safe so
if
> you are using the extension on a hight trafic server under Apache or
ISAPI
> you might find odd problems. This has nothing to do with PHP. Using it
> under CGI or FastCGI will remove all these problems.
> 
> Another solution would be to use the mssql extension with another
library.
> FreeTDS is providing an exelent replacement for msdblib. Look at
> http://kromann.info/php.php. The download site on the right hand side
> include this extension. It's called php_dblib.dll and it's a drop-in
> replacement for php_mssql.dll. No recoding required.
> 
> - Frank
> 
> 
> > It doesn't matter, the problem lies within php. To solve this problem
> you have to use a client that usage pooling like ODBC -> MSSQL. So my
next
> step is to rewrite all mssql code to ODBC.
> > 
> > This is not a problem if you run a small mssql server, buy if you
have
> over 100 databases with a lot of activity windows starts to act really
> strange because of a bug in php. (read more in Zend forum)
> > 
> > But who works with php and mssql? :-) (except me)
> > 
> > //Jocke
> > 
> > -----Ursprungligt meddelande-----
> > Från: Robert Twitty [mailto:rtwitty@xxxxxxxxxxxxxxxxx] 
> > Skickat: den 15 november 2005 14:20
> > Till: Joakim Ling
> > Kopia: php windows
> > Ämne: Re:  mssql tcp
> > 
> > Are you using mssql_pconnect() to connect to the database?
> > 
> > -- bob
> > 
> > On Mon, 14 Nov 2005, Joakim Ling wrote:
> > 
> > > Hi
> > >
> > >
> > >
> > > When I connect to my MSSQL server (internal) with mssql_connect,
make
> a
> > > few queries etc and then close the connection link. It creates a
TCP
> > > connection each time (for every query). I'm running Win 2003 STD,
> IIS6,
> > > PHP5, MSSQL2000. The problem is that the connection doesn't close
> > > correctly so after a few minutes I will have a lot of TCP
connections
> > > that looks like this:
> > >
> > >
> > >
> > > (With "netstat -ap tcp")
> > >
> > >   TCP    w1new:22953            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22954            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22955            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22956            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22957            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22958            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22959            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22960            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22961            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22962            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22963            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22964            w1new:ms-sql-s         TIME_WAIT
> > >
> > >   TCP    w1new:22965            w1new:ms-sql-s         TIME_WAIT
> > >
> > >
> > >
> > > After rebooting and running a few minutes the list is full and
> Windows
> > > begins to act really strange, not so strange when mssql has more
then
> > > 10000 TIME_WAIT connections waiting to close, but how to close
> them????
> > > mssql_close(); has no effect to this problem.
> > >
> > >
> > >
> > > I changed the TCPTimeWaitDelay value to 30 in regedit to increase
> > > connections, but still a huge problem. Anyone experience this
before
> or
> > > knows if converting to ODBC would work better?
> > >
> > >
> > >
> > >
> > >
> > > Best regards
> > >
> > > Joakim Ling
> > >
> > >
> > 
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> 
> 
> 
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux