Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #270049

Re: Having ten thousands of mount bind causes various processes to go into loops

From Richard <rrosner5@gmail.com>
Newsgroups linux.debian.user
Subject Re: Having ten thousands of mount bind causes various processes to go into loops
Date 2024-06-12 19:10 +0200
Message-ID <IOzDX-2qrU-1@gated-at.bofh.it> (permalink)
References <IOtfb-2mws-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Best question probably is: what exactly are you needing 14.000 mounts for?
Even snaps shouldn't be that ridiculous. So what's your use case? Maybe
there's a better solution to what you are doing. If it's just about having
a place that is rw only without execution permissions, just crate a
separate partition, mount it somewhere - e.g. /home/test/mounts and tell
mount/fstab to use the option noexec. No need for for your script. Or if
it's a more advanced file system like btrfs you may be able to simply
create a subvolume with the same capabilities, no need to tinker around
with partitions.

It's true this issue should be looked into, but it doesn't look urgent as
long as there are alternatives.

Richard

Am Mi., 12. Juni 2024 um 16:33 Uhr schrieb Julien Petit <julien@nethik.fr>:

> Dear,
>
> Not sure i should report a bug so here is a report first. For more
> than 10 years now, we've been using mount binds to create shares rw or
> ro. It's been working perfectly under older Debian. A few months ago,
> we migrated to Ubuntu Jammy and started having processes running 100%
> non stop. While examining the processes in question, we could see the
> same thing: it seemed to be reading all the mounts indefinitely.
> It started with the phpsessionclean.service. We managed to fix it
> editing /lib/systemd/system/phpsessionclean.service and disabling
> sandboxing entries. But then it started to happen with other
> processes.
> Anything related to systemd seems affected in a way. For instance, we
> cannot start haproxy if the mounts are mounted.
> We tested with the last Debian and it is affected too.
>
> We understand that 14 000 mounts is a lot. So maybe our usage will be
> questioned. But this has been working for ages so why not now?
>
> The problem can be very easily reproduced:
>
> 1. Launch the latest Debian stable
> 2. Execute the following script to create mounts:
> #!/bin/bash
> mkdir /home/test/directories
> mkdir /home/test/mounts
>
> for i in {1..14000}
> do
>    echo "Mounting dir $i"
>    mkdir "/home/test/directories/dir_$i"
>    mkdir "/home/test/mounts/dir_$i"
>    mount --bind -o rw "/home/test/directories/dir_$i"
> "/home/test/mounts/dir_$i"
> done
>
> After that, the "top" command will show processes getting stuck using
> 100% of CPU never ending.
>
> Has anyone a clue if this is fixable? Should i report a bug?
> Thanks for your help.
>
>

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Having ten thousands of mount bind causes various processes to go  into loops Julien Petit <julien@nethik.fr> - 2024-06-12 12:20 +0200
  Re: Having ten thousands of mount bind causes various processes to go  into loops Max Nikulin <manikulin@gmail.com> - 2024-06-12 18:20 +0200
  Re: Having ten thousands of mount bind causes various processes to go  into loops Richard <rrosner5@gmail.com> - 2024-06-12 19:10 +0200
    Re: Having ten thousands of mount bind causes various processes to go  into loops Julien Petit <julien@nethik.fr> - 2024-06-14 12:00 +0200
      Re: Having ten thousands of mount bind causes various processes to go  into loops Richard <rrosner5@gmail.com> - 2024-06-14 13:00 +0200
        Re: Having ten thousands of mount bind causes various processes to go  into loops Julien Petit <julien@nethik.fr> - 2024-06-19 11:10 +0200

csiph-web