[Monetdb-developers] monetdbd takes too long to start
Hi, in Ubuntu 10.04 (as far as I remember it happens in other releases too) monetdbd takes about 10 seconds to start as opposed to mac os x 10.6 and 10.7 in which it starts instantaneously. Inspecting connections.c, the delay is due to the call on gethostbyaddr(). Reading the respective man page, getting the hostname involves a number of steps ranging from looking at /etc/hosts.conf, /etc/hosts, as well as consulting named for resolving the ip address. What's more, the man page states explicitly that gethostbyaddr() is obsolete and suggests the use of getnameinfo() instead. Correspondingly, the man page in os x recommends the use of getnameinfo() as well, but without stating any explanation for this. Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too? Thanks, Babis
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway. Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEAREKAAYFAk7ivq8ACgkQYH1+F2Rqwn0CZwCdF3nwwDwqxH6cr1cS78qeNb1m 7x0AnRdLuPqxV/qDEXGjLRIEllHsIjC7 =6qlI -----END PGP SIGNATURE-----
On 10-12-2011 03:06:39 +0100, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway.
Could very well be. It's a Ubuntu-only "feature".
Unfortunately, disabling IPv6 still requires exactly the same amount of time.
Any other suggestions?
Thanks,
Babis
On Sat, Dec 10, 2011 at 10:23 AM, Fabian Groffen
On 10-12-2011 03:06:39 +0100, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway.
Could very well be. It's a Ubuntu-only "feature".
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
Babis, since we don't have Ubuntu machines running and (hence) are no Ubuntu experts, please feel free to replace gethostbyaddr() and gethostbyname() by getaddrinfo() and getnameinfo() in your local checkout of MonetDB and report what you experience. Stefan On Sat, Dec 10, 2011 at 01:01:15PM +0200, Charalampos Nikolaou wrote:
Unfortunately, disabling IPv6 still requires exactly the same amount of time.
Any other suggestions?
Thanks, Babis
On Sat, Dec 10, 2011 at 10:23 AM, Fabian Groffen
wrote: On 10-12-2011 03:06:39 +0100, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway.
Could very well be. It's a Ubuntu-only "feature".
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
That is what I was intending to do, but first I opted to ask the experts.
Regards,
Babis
On Sat, Dec 10, 2011 at 2:15 PM, Stefan Manegold
Babis,
since we don't have Ubuntu machines running and (hence) are no Ubuntu experts, please feel free to replace gethostbyaddr() and gethostbyname() by getaddrinfo() and getnameinfo() in your local checkout of MonetDB and report what you experience.
Stefan
On Sat, Dec 10, 2011 at 01:01:15PM +0200, Charalampos Nikolaou wrote:
Unfortunately, disabling IPv6 still requires exactly the same amount of time.
Any other suggestions?
Thanks, Babis
On Sat, Dec 10, 2011 at 10:23 AM, Fabian Groffen
wrote: On 10-12-2011 03:06:39 +0100, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway.
Could very well be. It's a Ubuntu-only "feature".
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
Hi,
just used getnameinfo() instead of gethostbyaddr() in
openConnectionTCP() and it doesn't gain any time improvement. In
addition, inspecting openConnectionUDP(), I saw that it uses
getnameinfo() instead of gethostbyaddr() and it is slow as well. What
I found, though, is that the trouble is caused by INADDR_ANY (i.e.,
0.0.0.0). If 127.0.0.1 or a specific, external ip is given, then both
getnameinfo() and gethostbyaddr() return instantaneously. After all,
is there any point of resolving 0.0.0.0? Anyway, regardless the ip
given, I think that resolving should be done in a timely manner, don't
you think. Time permitting, I shall further inspect the problem to
find out whether it is an issue in glibc or specific to system
configuration (of Ubuntu).
Regards,
Babis
On Sat, Dec 10, 2011 at 6:40 PM, Charalampos Nikolaou
That is what I was intending to do, but first I opted to ask the experts.
Regards, Babis
On Sat, Dec 10, 2011 at 2:15 PM, Stefan Manegold
wrote: Babis,
since we don't have Ubuntu machines running and (hence) are no Ubuntu experts, please feel free to replace gethostbyaddr() and gethostbyname() by getaddrinfo() and getnameinfo() in your local checkout of MonetDB and report what you experience.
Stefan
On Sat, Dec 10, 2011 at 01:01:15PM +0200, Charalampos Nikolaou wrote:
Unfortunately, disabling IPv6 still requires exactly the same amount of time.
Any other suggestions?
Thanks, Babis
On Sat, Dec 10, 2011 at 10:23 AM, Fabian Groffen
wrote: On 10-12-2011 03:06:39 +0100, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Op 10-12-11 03:02, Charalampos Nikolaou schreef:
Have you investigated this issue? Do you know what causes such a delay? Is it present in other OSs too?
On Ubuntu, is by any chance IPv6 enabled? This could already count for a 5s resolving time-out, based on the fallback scenario where IPv4 is used anyway.
Could very well be. It's a Ubuntu-only "feature".
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
On Mon, Dec 12, 2011 at 12:10:33AM +0200, Charalampos Nikolaou wrote:
Hi,
just used getnameinfo() instead of gethostbyaddr() in openConnectionTCP() and it doesn't gain any time improvement. In addition, inspecting openConnectionUDP(), I saw that it uses getnameinfo() instead of gethostbyaddr() and it is slow as well. What I found, though, is that the trouble is caused by INADDR_ANY (i.e., 0.0.0.0). If 127.0.0.1 or a specific, external ip is given, then both getnameinfo() and gethostbyaddr() return instantaneously. After all, is there any point of resolving 0.0.0.0?
- not requiring to know the IP of the machine we're running on - on machines with multiple interfaces (and hence multiple IPs), receive packets from all interfaces, i.e., sent to any of the IPs.
Anyway, regardless the ip given, I think that resolving should be done in a timely manner, don't you think.
Indeed. I have no idea, though, why/how Ubuntu mnages to mess this up. What else can we as humble application programmers do other than using standard systems call and rely on the OS to implement them correctly and efficiently. I'm not aware of such problems on any platfrom we're usually using / testing on; cf., http://monetdb.cwi.nl/testweb/web/status.php
Time permitting, I shall further inspect the problem to find out whether it is an issue in glibc or specific to system configuration (of Ubuntu).
Ok. Please keep us posted about what you find out. Simple question: what do time host 0.0.0.0 and time host 127.0.0.1 say? Stefan
Regards, Babis
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
On 12-12-2011 00:10:33 +0200, Charalampos Nikolaou wrote:
Hi,
just used getnameinfo() instead of gethostbyaddr() in openConnectionTCP() and it doesn't gain any time improvement. In addition, inspecting openConnectionUDP(), I saw that it uses getnameinfo() instead of gethostbyaddr() and it is slow as well. What I found, though, is that the trouble is caused by INADDR_ANY (i.e., 0.0.0.0). If 127.0.0.1 or a specific, external ip is given, then both getnameinfo() and gethostbyaddr() return instantaneously. After all, is there any point of resolving 0.0.0.0? Anyway, regardless the ip given, I think that resolving should be done in a timely manner, don't you think. Time permitting, I shall further inspect the problem to find out whether it is an issue in glibc or specific to system configuration (of Ubuntu).
Perhaps it's a firewall configuration that doesn't like the broadcast interface, and/or broadcasting packets at all.
Stefan,
the output is the following:
$ time host 0.0.0.0
Host 0.0.0.0.in-addr.arpa. not found: 3(NXDOMAIN)
real 0m0.040s
user 0m0.000s
sys 0m0.010s
charnik@nireas:~$ time host 127.0.0.1
1.0.0.127.in-addr.arpa domain name pointer localhost.
real 0m0.022s
user 0m0.000s
sys 0m0.010s
On Mon, Dec 12, 2011 at 9:32 AM, Fabian Groffen
On 12-12-2011 00:10:33 +0200, Charalampos Nikolaou wrote:
Hi,
just used getnameinfo() instead of gethostbyaddr() in openConnectionTCP() and it doesn't gain any time improvement. In addition, inspecting openConnectionUDP(), I saw that it uses getnameinfo() instead of gethostbyaddr() and it is slow as well. What I found, though, is that the trouble is caused by INADDR_ANY (i.e., 0.0.0.0). If 127.0.0.1 or a specific, external ip is given, then both getnameinfo() and gethostbyaddr() return instantaneously. After all, is there any point of resolving 0.0.0.0? Anyway, regardless the ip given, I think that resolving should be done in a timely manner, don't you think. Time permitting, I shall further inspect the problem to find out whether it is an issue in glibc or specific to system configuration (of Ubuntu).
Perhaps it's a firewall configuration that doesn't like the broadcast interface, and/or broadcasting packets at all.
@Fabian: I have checked it with and without firewall enabled and it takes the same amount of time. Regards, Babis
------------------------------------------------------------------------------ Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
Can you also check what happens if you add to /etc/resolv.conf: options single-request (Just to exclude it is not some form of glibc 2.10+ dns/firewall issue.) Stefan
Hi,
I found the culprit which was avahi-daemon... By disabling
avahi-daemon, gethostbyaddr() (and similarly getnameinfo()) returns
instantaneously. I wonder whether avahi-daemon is enabled by default
in distributions like Debian and Fedora. From this page
(http://avahi.org/wiki/AboutAvahi#Distributions) it seems that avahi
is included in those distributions. Maybe it is a matter of
configuration then.
Regards,
Babis
P.S.: Thank you Rémy for suggesting strace. It is a very helpful command.
On Mon, Dec 12, 2011 at 1:48 PM, Charalampos Nikolaou
Same behavior.
Babis
On Mon, Dec 12, 2011 at 12:16 PM, Stefan de Konink
wrote: Can you also check what happens if you add to /etc/resolv.conf:
options single-request
(Just to exclude it is not some form of glibc 2.10+ dns/firewall issue.)
Stefan
On Dec 12, 2011, at 10:37 AM, Charalampos Nikolaou wrote:
Stefan,
the output is the following:
$ time host 0.0.0.0 Host 0.0.0.0.in-addr.arpa. not found: 3(NXDOMAIN)
real 0m0.040s user 0m0.000s sys 0m0.010s charnik@nireas:~$ time host 127.0.0.1 1.0.0.127.in-addr.arpa domain name pointer localhost.
real 0m0.022s user 0m0.000s sys 0m0.010s
Hello, if you install the "strace" utility, using its "-tt" option should give precise timings on where CPU time is spent: $ strace -tt /path/to/command -- Rémy
participants (5)
-
Charalampos Nikolaou
-
Fabian Groffen
-
Rémy Chibois
-
Stefan de Konink
-
Stefan Manegold