High disk IO when running WHO query #706

Closed
opened 2026-10-05 04:39:46 +02:00 by adam · 8 comments
Owner

When a WHO query is run through znc, for the entire time who responses are being received, ~5mbps of disk IO happens. It's not writing to the debug log, and it's almost certainly not the IRC logs generated by the log module.

ZNC version: 1.6.3
OS: Debian wheezy

When a WHO query is run through znc, for the entire time who responses are being received, ~5mbps of disk IO happens. It's not writing to the debug log, and it's almost certainly not the IRC logs generated by the log module. ZNC version: 1.6.3 OS: Debian wheezy ## <!-- github-sync-id:154534302 -->
adam closed this issue 2026-10-05 04:39:46 +02:00
Author
Owner

Does it happen every time?
What does strace say?
Can it be swapping because of low RAM?

Does it happen every time? What does `strace` say? Can it be swapping because of low RAM? <!-- github-comment-id:218878337 -->
Author
Owner

It happens every time, and I have plenty of free ram. Swap I/O doesn't seem to be happening.

I haven't run strace yet, I'll see if I can reproduce and test it more on my local machine tomorrow or later.

It happens every time, and I have plenty of free ram. Swap I/O doesn't seem to be happening. I haven't run strace yet, I'll see if I can reproduce and test it more on my local machine tomorrow or later. <!-- github-comment-id:218910109 -->
Author
Owner

Which modules are loaded? That might make a difference as well.

Which modules are loaded? That might make a difference as well. <!-- github-comment-id:218965282 -->
Author
Owner
Just guessing http://wiki.znc.in/Aka_(nicktrace) . <!-- github-comment-id:219013727 -->
Author
Owner

If you have updates, reopen

If you have updates, reopen <!-- github-comment-id:260985108 -->
Author
Owner

Sorry, I forgot about this. Still happening:

<RX14> listmods
<*status> Global modules:
<*status> +===========+===========+
<*status> | Name      | Arguments |
<*status> +===========+===========+
<*status> | webadmin  |           |
<*status> +-----------+-----------+
<*status> | adminlog  |           |
<*status> +-----------+-----------+
<*status> | certauth  |           |
<*status> +-----------+-----------+
<*status> | chansaver |           |
<*status> +-----------+-----------+
<*status> | partyline |           |
<*status> +-----------+-----------+
<*status> | identfile |           |
<*status> +===========+===========+
<*status> User modules:
<*status> +==============+===========+
<*status> | Name         | Arguments |
<*status> +==============+===========+
<*status> | cert         |           |
<*status> +--------------+-----------+
<*status> | chansaver    |           |
<*status> +--------------+-----------+
<*status> | clientnotify |           |
<*status> +--------------+-----------+
<*status> | controlpanel |           |
<*status> +--------------+-----------+
<*status> | log          |           |
<*status> +--------------+-----------+
<*status> | perform      |           |
<*status> +==============+===========+
<*status> Network modules:
<*status> +==============+===========+
<*status> | Name         | Arguments |
<*status> +==============+===========+
<*status> | chansaver    |           |
<*status> +--------------+-----------+
<*status> | kickrejoin   |           |
<*status> +--------------+-----------+
<*status> | clientbuffer | autoadd   |
<*status> +--------------+-----------+
<*status> | perform      |           |
<*status> +==============+===========+

Plenty of ram, strace shows this (who on a channel with 975 members):

$ strace -c -p 23199
Process 23199 attached - interrupt to quit
^CProcess 23199 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 97.04    0.028303           0    584939           write
  1.40    0.000407           2       247        16 open
  1.03    0.000300           1       231           close
  0.42    0.000122           1       149           poll
  0.07    0.000020           0        56           munmap
  0.05    0.000015           0       477           read
  0.00    0.000000           0       291        16 stat
  0.00    0.000000           0       112           fstat
  0.00    0.000000           0        56           lseek
  0.00    0.000000           0        56           mmap
  0.00    0.000000           0       350           fcntl
------ ----------- ----------- --------- --------- ----------------
100.00    0.029167                586964        32 total

The culprit seems to be an open("/data/znc/znc-data//users/RX14/networks/esper/moddata/clientbuffer/.registry", O_WRONLY|O_CREAT|O_TRUNC, 0600), followed by a crazy amount of write calls (15433 for a who on a channel with only 7 members).

Sorry, I forgot about this. Still happening: ``` <RX14> listmods <*status> Global modules: <*status> +===========+===========+ <*status> | Name | Arguments | <*status> +===========+===========+ <*status> | webadmin | | <*status> +-----------+-----------+ <*status> | adminlog | | <*status> +-----------+-----------+ <*status> | certauth | | <*status> +-----------+-----------+ <*status> | chansaver | | <*status> +-----------+-----------+ <*status> | partyline | | <*status> +-----------+-----------+ <*status> | identfile | | <*status> +===========+===========+ <*status> User modules: <*status> +==============+===========+ <*status> | Name | Arguments | <*status> +==============+===========+ <*status> | cert | | <*status> +--------------+-----------+ <*status> | chansaver | | <*status> +--------------+-----------+ <*status> | clientnotify | | <*status> +--------------+-----------+ <*status> | controlpanel | | <*status> +--------------+-----------+ <*status> | log | | <*status> +--------------+-----------+ <*status> | perform | | <*status> +==============+===========+ <*status> Network modules: <*status> +==============+===========+ <*status> | Name | Arguments | <*status> +==============+===========+ <*status> | chansaver | | <*status> +--------------+-----------+ <*status> | kickrejoin | | <*status> +--------------+-----------+ <*status> | clientbuffer | autoadd | <*status> +--------------+-----------+ <*status> | perform | | <*status> +==============+===========+ ``` Plenty of ram, `strace` shows this (who on a channel with 975 members): ``` $ strace -c -p 23199 Process 23199 attached - interrupt to quit ^CProcess 23199 detached % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 97.04 0.028303 0 584939 write 1.40 0.000407 2 247 16 open 1.03 0.000300 1 231 close 0.42 0.000122 1 149 poll 0.07 0.000020 0 56 munmap 0.05 0.000015 0 477 read 0.00 0.000000 0 291 16 stat 0.00 0.000000 0 112 fstat 0.00 0.000000 0 56 lseek 0.00 0.000000 0 56 mmap 0.00 0.000000 0 350 fcntl ------ ----------- ----------- --------- --------- ---------------- 100.00 0.029167 586964 32 total ``` The culprit seems to be an `open("/data/znc/znc-data//users/RX14/networks/esper/moddata/clientbuffer/.registry", O_WRONLY|O_CREAT|O_TRUNC, 0600)`, followed by a crazy amount of `write` calls (15433 for a who on a channel with only 7 members). <!-- github-comment-id:260994345 -->
Author
Owner

clientbuffer is an external module.
Looks like it writes that file on every message received from every client and sent to every client.
There's nothing upstream ZNC can do here.

clientbuffer is an external module. Looks like it [writes](https://github.com/jpnurmi/znc-clientbuffer/blob/74f6b3893cd2bb3ca390f4eaa15dd1baeec41f8c/clientbuffer.cpp#L285) that file on every message received from every client and sent to every client. There's nothing upstream ZNC can do here. <!-- github-comment-id:261000116 -->
Author
Owner

Sorry about that, it's been so long since I set up znc I forgot that clientbuffer was an external module, I'll report it over there.

Sorry about that, it's been so long since I set up znc I forgot that clientbuffer was an external module, I'll report it over there. <!-- github-comment-id:261000666 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#706