netstat showing multiple lines for each listening socket
Tom Marcoen (EXT)
tom.marcoen at hightechcampus.com
Wed Jul 10 12:20:57 UTC 2024
My server has four (virtual; it runs on vSphere) CPUs and also shows four lines in `ss` output.
The `ps` command shows the `-U` which - I assume - is set automatically triggered by the number of CPUs.
# ps -elf | grep named
5 S named 23769 1 9 80 0 - 251941 do_sig 07:12 ? 00:39:02 /usr/local/sbin/named -U4 -u named -c /usr/local/etc/namedb/named.conf
I am still in the process of figuring out my predecessor's custom setup...
-----Oorspronkelijk bericht-----
Van: Thomas Hungenberg <th+bind at cert-bund.de>
Verzonden: dinsdag 9 juli 2024 14:52
Aan: Lee <ler762 at gmail.com>; Tom Marcoen (EXT) <tom.marcoen at hightechcampus.com>; bind-users at lists.isc.org
Onderwerp: Re: netstat showing multiple lines for each listening socket
On 08.07.24 15:59, Lee wrote:
> How many cpus does your machine have?
> I'm running bind at home; not a whole lot of traffic to named so it
> seemed like all those threads were a waste. So pretend there's only
> one cpu:
> $ grep bind /etc/default/named
> # OPTIONS="-u bind "
> OPTIONS="-u bind -n 1"
Thanks!
I can confirm netstat and ss show only one line per socket when starting
named with option "-n 1".
However, according to the manpage there should be "*two* threads per each CPU present":
=========================================
-n #cpus
This option controls the number of CPUs that named assumes the presence of.
If not specified, named tries to determine the number of CPUs
present automatically; if it fails, a single CPU is assumed to be present.
named creates two threads per each CPU present (one thread for receiving
and sending client traffic and another thread for sending and
receiving resolver traffic) and then on top of that a single thread for
handling time-based events.
=========================================
When running named without setting "-n" on a test VM with a single CPU assigned,
I see two threads per socket which matches what the manpage says.
When starting named with "-n 1" I would expect to see two threads as well
but there is only one in the netstat / ss output.
And on a small embedded system with a single CPU, it creates *four* threads
per socket.
Hmmm...
- Thomas
________________________________________
Disclaimer High Tech Campus Eindhoven: The information contained in this message and attachments may be confidential and legally protected under applicable law. The message and attachments are intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message and attachments is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. Please visit: http://www.hightechcampus.com/go/pages/disclaimer for the most recent disclaimer.
More information about the bind-users
mailing list