🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.fs
4 messages
4 total messages Started by Zaphod Beeblebrox Sun, 18 Oct 2026 23:57
Terminal number of files in a ZFS directory.
#9
Author: Zaphod Beeblebrox
Date: Sun, 18 Oct 2026 23:57
62 lines
8619 bytes
--000000000000919119065e262acb
Content-Type: text/plain; charset="UTF-8"

The TLDR is "I don't know, but I have such a directory".

The directory developed on a jail.   It was the maildrop directory for a
postfix no longer running as the server had become a jail and no longer
needed it's own mail service.  The maildrop, however, continued to receive
cron generated periodic mail for years.  So that's 2 per day plus another
one per week, IIRC.  That would be about 5980 email per year.  Now... give
it 15 years ... 89700?  That doesn't seem like enough.  There must have
been more crap.

On the jail server, the zfs filesystem only occupies about 10G.  echo * on
the directory runs at 100% cpu for over a week.  So I reboot (to stop it...
it's stuck in kernel) and zfs send it to a NVME only system (my desktop)
and try again.  I was thinking that much faster disk could compensate for
abominably bad big-O behavior.  But this two ran for a week without
finishing.

What are the limits we're running into here.  This is academic.  I can
solve the problem (already have).  I still don't know what the limit is.
Somewhere around September 15th, this directory started sticking finds and
whatnot --- so it tipped over from working to broken.  I have the
filesystem, BTW...

What is this limit that toggles zfs from working large directory to
completely broken sysadmin problem?

--000000000000919119065e262acb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>The=C2=A0TLDR is &quot;I don&#39;t know, but I have s=
uch a directory&quot;.</div><div><br></div><div>The directory developed on =
a jail.=C2=A0 =C2=A0It was the maildrop directory for a postfix no longer r=
unning as the server had become a jail and no longer needed it&#39;s own ma=
il service.=C2=A0 The maildrop, however, continued to receive cron generate=
d periodic mail for years.=C2=A0 So that&#39;s 2 per day plus another one p=
er week, IIRC.=C2=A0 That would be about 5980 email per year.=C2=A0 Now... =
give it 15 years ... 89700?=C2=A0 That doesn&#39;t seem like enough.=C2=A0 =
There must have been more crap.</div><div><br></div><div>On the jail server=
, the zfs filesystem only occupies about 10G.=C2=A0 echo * on the directory=
 runs at 100% cpu for over a week.=C2=A0 So I reboot (to stop it... it&#39;=
s stuck in kernel) and zfs send it to a NVME only system (my desktop) and t=
ry again.=C2=A0 I was thinking that much faster disk could compensate for a=
bominably bad big-O behavior.=C2=A0 But this two ran for a week without fin=
ishing.</div><div><br></div><div>What are the limits we&#39;re running into=
 here.=C2=A0 This is academic.=C2=A0 I can solve the problem (already have)=
.=C2=A0 I still don&#39;t know what the limit is.=C2=A0 Somewhere around Se=
ptember 15th, this directory started sticking finds and whatnot --- so it t=
ipped over from working to broken.=C2=A0 I have the filesystem, BTW...=C2=
=A0</div><div><br></div><div>What is this limit that toggles zfs from worki=
ng large directory to completely broken sysadmin problem?</div><div><br></d=
iv></div>

--000000000000919119065e262acb--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: Terminal number of files in a ZFS directory.
#11
Author: Bakul Shah
Date: Mon, 19 Oct 2026 21:59
27 lines
6661 bytes
On Oct 18, 2026, at 4:58 PM, Zaphod Beeblebrox <zbeeble@gmail.com> wrote:
> 
> 
> On the jail server, the zfs filesystem only occupies about 10G.  echo * on the directory runs at 100% cpu for over a week.  So I reboot (to stop it... it's stuck in kernel) and zfs send it to a NVME only system (my desktop) and try again.  I was thinking that much faster disk could compensate for abominably bad big-O behavior.  But this two ran for a week without finishing.

See if “find -f .” in the directory completes. That “-f”
avoids sorting dir entries.  What may be happening is in
“echo *” the (implicit) sorting of filenames will require
buffering up all the names possibly resulting in swapping.
Check if swap use is increasing. Also do “ls -ld .” to see
dir space use. You can also check process memory use while
"echo *" is churning away.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: Terminal number of files in a ZFS directory.
#12
Author: Zaphod Beeblebrox
Date: Tue, 20 Oct 2026 04:43
110 lines
11128 bytes
--0000000000004fa67d065e3e4670
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ok... first, on the shell.  Echo can handle absurd amounts of data.  Try
"echo `cat file`" sometime.  The limitation on argument length is on the
launching of a new process, not in the shell itself.  I have never run into
a limitation on the shell argument parsing.  Certainly you can do stuff
like "echo * | xargs rm" just fine... even though "rm *" wouldn't work.

That-all-said, the bash process never grows beyond 25M.  The ARC gets large
--- I'm sure this is ZFS dying.  Once I run the echo * command, even the
parent directory of the problem directory can't be listed.

On Mon, Oct 19, 2026 at 6:00=E2=80=AFPM Bakul Shah <bakul@iitbombay.org> wr=
ote:

>
> On Oct 18, 2026, at 4:58=E2=80=AFPM, Zaphod Beeblebrox <zbeeble@gmail.com=
> wrote:
> >
> >
> > On the jail server, the zfs filesystem only occupies about 10G.  echo *
> on the directory runs at 100% cpu for over a week.  So I reboot (to stop
> it... it's stuck in kernel) and zfs send it to a NVME only system (my
> desktop) and try again.  I was thinking that much faster disk could
> compensate for abominably bad big-O behavior.  But this two ran for a wee=
k
> without finishing.
>
> See if =E2=80=9Cfind -f .=E2=80=9D in the directory completes. That =E2=
=80=9C-f=E2=80=9D
> avoids sorting dir entries.  What may be happening is in
> =E2=80=9Cecho *=E2=80=9D the (implicit) sorting of filenames will require
> buffering up all the names possibly resulting in swapping.
> Check if swap use is increasing. Also do =E2=80=9Cls -ld .=E2=80=9D to se=
e
> dir space use. You can also check process memory use while
> "echo *" is churning away.


so echo * itself isn't a problem (see above).  The zfs filesystem causing
the problem becomes more and more inoperative.  After some time the parent
of the parent of the problem can't be listed.  Other zfs filesystems on the
host continue to work, tho.

And this machine has 384G of RAM on it.

In terms of find and friends, any access to the directory locks the process
in D-state.  If it was any problem sorting, the shell would be killable
(it's not).  In fact, I found this problem directory because the daily
finds were going there to die.  "du" also locks it up.

--0000000000004fa67d065e3e4670
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Ok... first, on the shell.=C2=A0 Echo can handle absu=
rd amounts of data.=C2=A0 Try &quot;echo `cat file`&quot; sometime.=C2=A0 T=
he limitation on argument length is on the launching of a new process, not =
in the shell itself.=C2=A0 I have never run into a limitation on the shell =
argument parsing.=C2=A0 Certainly you can do stuff like &quot;echo * | xarg=
s rm&quot; just fine... even though &quot;rm *&quot; wouldn&#39;t work.</di=
v><div><br></div><div>That-all-said, the bash process never grows beyond 25=
M.=C2=A0 The ARC gets large --- I&#39;m sure this is ZFS dying.=C2=A0 Once =
I run the echo * command, even the parent directory of the problem director=
y can&#39;t be listed.</div><br><div class=3D"gmail_quote gmail_quote_conta=
iner"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Oct 19, 2026 at 6:00=E2=
=80=AFPM Bakul Shah &lt;<a href=3D"mailto:bakul@iitbombay.org">bakul@iitbom=
bay.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex"><br>
On Oct 18, 2026, at 4:58=E2=80=AFPM, Zaphod Beeblebrox &lt;<a href=3D"mailt=
o:zbeeble@gmail.com" target=3D"_blank">zbeeble@gmail.com</a>&gt; wrote:<br>
&gt; <br>
&gt; <br>
&gt; On the jail server, the zfs filesystem only occupies about 10G.=C2=A0 =
echo * on the directory runs at 100% cpu for over a week.=C2=A0 So I reboot=
 (to stop it... it&#39;s stuck in kernel) and zfs send it to a NVME only sy=
stem (my desktop) and try again.=C2=A0 I was thinking that much faster disk=
 could compensate for abominably bad big-O behavior.=C2=A0 But this two ran=
 for a week without finishing.<br>
<br>
See if =E2=80=9Cfind -f .=E2=80=9D in the directory completes. That =E2=80=
=9C-f=E2=80=9D<br>
avoids sorting dir entries.=C2=A0 What may be happening is in<br>
=E2=80=9Cecho *=E2=80=9D the (implicit) sorting of filenames will require<b=
r>
buffering up all the names possibly resulting in swapping.<br>
Check if swap use is increasing. Also do =E2=80=9Cls -ld .=E2=80=9D to see<=
br>
dir space use. You can also check process memory use while<br>
&quot;echo *&quot; is churning away.</blockquote><div><br></div><div>so ech=
o * itself isn&#39;t a problem (see above).=C2=A0 The zfs filesystem causin=
g the problem becomes more and more inoperative.=C2=A0 After some time the =
parent of the parent of the problem can&#39;t be listed.=C2=A0 Other zfs fi=
lesystems=C2=A0on the host continue to work, tho.</div><div><br></div><div>=
And this machine has 384G of RAM on it.</div><div><br></div><div>In terms o=
f find and friends, any access to the directory locks the process in D-stat=
e.=C2=A0 If it was any problem sorting, the shell would be killable (it&#39=
;s not).=C2=A0 In fact, I found this problem directory because the daily fi=
nds were going there to die.=C2=A0 &quot;du&quot; also locks it up.=C2=A0</=
div></div></div>

--0000000000004fa67d065e3e4670--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: Terminal number of files in a ZFS directory.
#13
Author: Dag-Erling Smørgrav
Date: Tue, 20 Oct 2026 11:13
19 lines
2585 bytes
Bakul Shah <bakul@iitbombay.org> writes:
> Zaphod Beeblebrox <zbeeble@gmail.com> writes:
> > On the jail server, the zfs filesystem only occupies about 10G.
> > echo * on the directory runs at 100% cpu for over a week.
> See if “find -f .” in the directory completes. That “-f”
> avoids sorting dir entries.

No.  You are confusing find(1) with ls(1).  A simple `find .` will do
the trick.

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads