Re: Mysterious 5 second delay on sybase_connect()

Charles Morris <[email protected]>
Newsgroups gmane.comp.php.database
Message-ID <CABgawubDUsFU7SLubcFyhh3sB9Wh+-1rghkin7tQBNUQbeOX9g@mail.gmail.com>
Very, glad I could help though :)

On Fri, May 25, 2012 at 3:34 AM, Tom Lloyd <[email protected]> wrote:
> nsswitch seems to be OK, but it wasn't aliased to localhost for ipv6.  I've fixed that now (and knocked back the ipv6 precedence in /etc/gai.conf) and it seems to be behaving...
>
> Still doesn't explain to me why it was looking itself up in the first place...  Weird :/
>
> -- Tom
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Charles Morris
> Sent: 24 May 2012 17:40
> To: Tom Lloyd
> Cc: Matijn Woudt; [email protected]
> Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()
>
> Is it's own host name in the hosts file and nsswitch.conf set up correctly?
>
> Alternatively disable all the ipv6 adapters if you aren't using them.
>
> On Thu, May 24, 2012 at 12:23 PM, Tom Lloyd <[email protected]> wrote:
>> Say the webserver is called foo, on the domain company.local.  No ipv6 is enabled in the network.  A network trace tells me that when the HTTP request comes in, the webserver sends out a DNS request for "AAAA foo.company.local".  Nothing replies, and after 5 seconds it times out and carries on doing what it was doing.
>>
>> Why would it be doing a DNS lookup for the IPv6 address of its own hostname?  And more urgently, how can I stop it?
>>
>> -----Original Message-----
>> From: Tom Lloyd
>> Sent: 24 May 2012 16:26
>> To: 'Matijn Woudt'
>> Cc: [email protected]
>> Subject: RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()
>>
>> I'm getting increasingly suspicious that DNS is to blame.  If I was to do something like:
>>
>> $conn = sybase_connect( "10.0.0.11\SQLMAIN", $user, $pass )
>>
>> Would that trigger a lookup of some variety?
>>
>> -----Original Message-----
>> From: Matijn Woudt [mailto:[email protected]]
>> Sent: 24 May 2012 13:00
>> To: Tom Lloyd
>> Cc: [email protected]
>> Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()
>>
>> On Thu, May 24, 2012 at 10:51 AM, Tom Lloyd <[email protected]> wrote:
>>> Hi there.  I'm working on a PHP-driven project on Debian Squeeze that
>>> connects to an instance of Microsoft SQL Server on Windows Server 2008.
>>> I'm using the sybase extensions to PHP.
>>>
>>> Since I rebooted the webserver on the weekend, both the
>>> sybase_connect() and sybase_pconnect() commands will sometimes take
>>> exactly 5 seconds to execute.  It seems to be random whether they do
>>> this or not.  I can't think of anything that could have been changed
>>> by the reboot, unless a package was updated but its associated process never got restarted...
>>>
>>> Does anyone know what might cause this behaviour?
>>>
>>> Cheers,
>>> Tom Lloyd
>>>
>>
>> It most likely has nothing to do with PHP, but is rather a routing issue. 5 seconds is the default connection time out for TCP/IP, so it probably makes sense that the connection is failing at a lower level.
>>
>> - Matijn

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.