<div dir="ltr"><div>Recently I got the same 100% CPU behavior as yours with unbound 1.10 and 1.9.6. Did you resolve the problem?<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Patrik Lundin via Unbound-users <<a href="mailto:unbound-users@nlnetlabs.nl">unbound-users@nlnetlabs.nl</a>> 于2019年9月23日周一 下午5:12写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Today I noticed a machine running Unbound 1.9.2 had gotten itself into<br>
an odd state.<br>
<br>
Running "unbound-control status" would just hang, and even after<br>
removing all client queries from the machine one of the CPUs in the<br>
server was still fully busy in 100% user time in top:<br>
===<br>
%Cpu4 :100.0 us, 0.0 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st<br>
===<br>
<br>
Keep in mind this is on a machine that except for some monitoring queries are<br>
seeing no traffic at this point:<br>
===<br>
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND<br>
5447 unbound 20 0 14.8g 14.2g 4320 S 100.0 22.7 3742:27 unbound<br>
===<br>
<br>
strace was fairly silent, which i guess makes sense since all time is<br>
spent in user space according to top:<br>
===<br>
# strace -f -p 5447<br>
strace: Process 5447 attached with 16 threads<br>
[pid 5489] epoll_wait(130, <unfinished ...><br>
[pid 5488] epoll_wait(133, <unfinished ...><br>
[pid 5487] epoll_wait(132, <unfinished ...><br>
[pid 5486] epoll_wait(143, <unfinished ...><br>
[pid 5485] epoll_wait(126, <unfinished ...><br>
[pid 5484] epoll_wait(127, <unfinished ...><br>
[pid 5483] epoll_wait(134, <unfinished ...><br>
[pid 5482] epoll_wait(121, <unfinished ...><br>
[pid 5481] epoll_wait(120, <unfinished ...><br>
[pid 5480] epoll_wait(115, <unfinished ...><br>
[pid 5479] epoll_wait(114, <unfinished ...><br>
[pid 5477] epoll_wait(105, <unfinished ...><br>
[pid 5476] epoll_wait(102, <unfinished ...><br>
[pid 5475] epoll_wait(104, <unfinished ...><br>
[pid 5447] read(70,<br>
===<br>
<br>
I do find that read to be a bit suspicious because I am not seeing anything<br>
equivalent on another machine that is not having any problems, though it is not<br>
clear to me what it is communicating with:<br>
===<br>
# lsof -n -P -p 5447<br>
[...]<br>
unbound 5447 unbound 70u unix 0xffff9090b9832400 0t0 20234 socket<br>
[...]<br>
===<br>
<br>
It appears being unbound talking to itself:<br>
===<br>
# ss -xp | grep 20234<br>
u_str ESTAB 0 0 * 20235 * 20234 users:(("unbound",pid=5447,fd=71))<br>
u_str ESTAB 0 0 * 20234 * 20235 users:(("unbound",pid=5447,fd=70))<br>
===<br>
<br>
Too me this feels like some race condition might have caused something to spin<br>
uncontrollably in the process.<br>
<br>
Looking at the process with GDB I can see the following for that read()'ing<br>
thread (thread apply all bt):<br>
===<br>
Thread 1 (Thread 0x7fa25fada840 (LWP 5447)):<br>
#0 0x00007fa25e87a6fd in read () from /lib64/libpthread.so.0<br>
#1 0x0000560e3305f285 in tube_read_msg ()<br>
#2 0x0000560e33014d81 in server_stats_obtain ()<br>
#3 0x0000560e3300f794 in do_stats.isra.12 ()<br>
#4 0x0000560e33011d18 in execute_cmd ()<br>
#5 0x0000560e33013fb8 in handle_req.isra.18 ()<br>
#6 0x0000560e330140d0 in remote_control_callback ()<br>
#7 0x00007fa25f423a14 in event_base_loop () from /lib64/libevent-2.0.so.5<br>
#8 0x0000560e330b140c in comm_base_dispatch ()<br>
#9 0x0000560e3300d8c1 in daemon_fork ()<br>
#10 0x0000560e3300942f in main ()<br>
===<br>
<br>
All remaining threads are sitting in epoll_wait except for this one:<br>
===<br>
Thread 13 (Thread 0x7fa25ad46700 (LWP 5478)):<br>
#0 0x00007fa25f4219e2 in event_queue_insert () from /lib64/libevent-2.0.so.5<br>
#1 0x00007fa25f421c24 in event_active_nolock () from /lib64/libevent-2.0.so.5<br>
#2 0x00007fa25f424426 in event_base_loop () from /lib64/libevent-2.0.so.5<br>
#3 0x0000560e330b140c in comm_base_dispatch ()<br>
#4 0x0000560e3300cf6f in thread_start ()<br>
#5 0x00007fa25e873dd5 in start_thread () from /lib64/libpthread.so.0<br>
#6 0x00007fa25e59d02d in clone () from /lib64/libc.so.6<br>
===<br>
<br>
Though if this is related I dont know at this point.<br>
<br>
Anyone else seeing something like this? Any guesses what might be wrong?<br>
<br>
== <br>
Patrik Lundin<br>
</blockquote></div>