Обсуждение: Slow connection once the PC is network connected

Поиск
Список
Период
Сортировка

Slow connection once the PC is network connected

От
Yan Cheng CHEOK
Дата:
Hello, I am deploying a database to customer PC, which will be only connected by local application.

However, I realize once the PC is network connected, the connection take extremely long time (around 10 seconds)

May I know why this happen? I was wondering whether is there any workaround to overcome this?

I connect the database using C++ code

PQconnectdb("dbname = ProductionFactory user = postgres password = password");

Thanks.

Thanks and Regards
Yan Cheng CHEOK




Re: Slow connection once the PC is network connected

От
Pavel Stehule
Дата:
Hello

check your dns service, first. second try to use IP address instead host name

Regards

Pavel Stehule

2010/10/26 Yan Cheng CHEOK <yccheok@yahoo.com>:
> Hello, I am deploying a database to customer PC, which will be only connected by local application.
>
> However, I realize once the PC is network connected, the connection take extremely long time (around 10 seconds)
>
> May I know why this happen? I was wondering whether is there any workaround to overcome this?
>
> I connect the database using C++ code
>
> PQconnectdb("dbname = ProductionFactory user = postgres password = password");
>
> Thanks.
>
> Thanks and Regards
> Yan Cheng CHEOK
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Re: Slow connection once the PC is network connected

От
Alban Hertroys
Дата:
On 26 Oct 2010, at 11:39, Yan Cheng CHEOK wrote:

> Hello, I am deploying a database to customer PC, which will be only connected by local application.
>
> However, I realize once the PC is network connected, the connection take extremely long time (around 10 seconds)

That sounds suspiciously like the default timeout for DNS lookups.
What platform is this? Windows?
Is that machine able to look up localhost?

> May I know why this happen? I was wondering whether is there any workaround to overcome this?
>
> I connect the database using C++ code
>
> PQconnectdb("dbname = ProductionFactory user = postgres password = password");


Does it help any to add hostaddr = 127.0.0.1 to that string?

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4cc6a70710292409920920!



Re: Slow connection once the PC is network connected

От
Yan Cheng CHEOK
Дата:
Thanks. That's work pretty well.

--- On Tue, 10/26/10, Alban Hertroys <dalroi@solfertje.student.utwente.nl> wrote:

> From: Alban Hertroys <dalroi@solfertje.student.utwente.nl>
> Subject: Re: [GENERAL] Slow connection once the PC is network connected
> To: "Yan Cheng CHEOK" <yccheok@yahoo.com>
> Cc: pgsql-general@postgresql.org
> Date: Tuesday, October 26, 2010, 6:01 PM
> On 26 Oct 2010, at 11:39, Yan Cheng
> CHEOK wrote:
>
> > Hello, I am deploying a database to customer PC, which
> will be only connected by local application.
> >
> > However, I realize once the PC is network connected,
> the connection take extremely long time (around 10 seconds)
>
> That sounds suspiciously like the default timeout for DNS
> lookups.
> What platform is this? Windows?
> Is that machine able to look up localhost?
>
> > May I know why this happen? I was wondering whether is
> there any workaround to overcome this?
> >
> > I connect the database using C++ code
> >
> > PQconnectdb("dbname = ProductionFactory user =
> postgres password = password");
>
>
> Does it help any to add hostaddr = 127.0.0.1 to that
> string?
>
> Alban Hertroys
>
> --
> Screwing up is an excellent way to attach something to the
> ceiling.
>
>
> !DSPAM:737,4cc6a70710292409920920!
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>