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

Asked by Julien

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. Its been working perfectly under older Debian. A few month 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 understand that 14 000 mounts is a lot. So maybe our usage will be questionned. But this has been working for ages so why not now?

The problem can be very easily reproduced:

1. Launch a new jammy vm : multipass launch jammy --name mytest --memory 1G --disk 10G --cpus 1
2. Install PHP : apt-get install php
3. Execute the following script to create mounts:
#!/bin/bash
mkdir /home/ubuntu/directories
mkdir /home/ubuntu/mounts

for i in {1..14000}
do
   echo "Mounting dir $i"
   mkdir "/home/ubuntu/directories/dir_$i"
   mkdir "/home/ubuntu/mounts/dir_$i"
   mount --bind -o rw "/home/ubuntu/directories/dir_$i" "/home/ubuntu/mounts/dir_$i"
done

After that, the next time the phpsessionclean.service will be launched, it will get stuck using 100% of CPU never ending.

Has anyone a clue if this is fixable? Should i report a bug?
Thanks for your help.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.