Description of problem: The NTP query program ntpq runs very slowly because it is constantly re-reading /etc/services while running. Version-Release number of selected component (if applicable): ntp-4.2.6p4-1.fc16.i686 How reproducible: 1. Start NTP with a few peers/servers, public is fine. 2. Run: strace -e open ntpq -pn Actual results: open("/etc/services", O_RDONLY|O_CLOEXEC) = 4 many many times Expected results: The /etc/services files should only be read in once. Additional info: Is this an NTP bug or a glibc bug?
This seems to come from the getaddrinfo() call in decodenetnum(). I'm not sure it's a bug. Enabling the nscd service seems to help.
(In reply to comment #1) > This seems to come from the getaddrinfo() call in decodenetnum(). > > I'm not sure it's a bug. Enabling the nscd service seems to help. So this means that glibc will read in /etc/services as many times as you call getaddrinfo in a program, and not save it in memory? That just doesn't seem right... So when I checked to see why nscd wasn't running, I found this: [19697.471683] nscd[770]: segfault at 7473797b ip 002a36ff sp ac4f57b0 error 4 in nscd[28f000+24000] [105137.569749] nscd[1533]: segfault at 7473797b ip 003856ff sp ac4f57b0 error 4 in nscd[371000+24000] Do you want a separate bug for that? Thanks, Doug
Let's reassign this to glibc.
The kind of caching proposed seems wrong to add to glibc as nothing prevents the mapping from service name to port # from changing between invocations of getaddrinfo. It would be better for ntp to get service port number once, then use the numeric port number is subsequent calls to getaddrinfo if you want to assume the port number does not change. It may be advisable to set AI_NUMERICSERV in the hints.ai_flags structure as well to ensure that service points to a numeric string rather than a port name.
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.
This problem is still present, reopening.
ntp-4.2.6p5-11.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/ntp-4.2.6p5-11.fc19
Package ntp-4.2.6p5-11.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing ntp-4.2.6p5-11.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-4660/ntp-4.2.6p5-11.fc19 then log in and leave karma (feedback).
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
ntp-4.2.6p5-11.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.