Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very low threads-max value on this kernel #307

Closed
sdeleeuw opened this issue Dec 14, 2024 · 2 comments
Closed

Very low threads-max value on this kernel #307

sdeleeuw opened this issue Dec 14, 2024 · 2 comments

Comments

@sdeleeuw
Copy link

sdeleeuw commented Dec 14, 2024

I have stability issues - crashed browser tabs and apps that refuse to start - on the latest Armbian + Noble + GNOME images on Rock 5C and Orange Pi 5. After some debugging, I found that the kernel's configured thread limit is hit in these cases.

# Rock 5C
sander@rock-5c:~$ cat /proc/sys/kernel/threads-max
1685

sander@rock-5c:~$ ulimit -u
842
# Orange Pi 5
sander@orangepi5:~$ cat /proc/sys/kernel/threads-max 
2378

sander@orangepi5:~$ ulimit -u
1189

The issue is worked around by making the following changes (and reboot):

# /etc/rc.local  (updated)
echo 16384 > /proc/sys/kernel/threads-max

# /etc/security/limits.d/99-nproc.conf   (created)
* soft nproc 4096
* hard nproc 4096

# /etc/systemd/system.conf  (updated)
#DefaultTasksMax=15%
DefaultTasksMax=infinity

I have been searching Armbian's build repository to find any code that sets these limits, but I couldn't find any. I believe that the defaults, calculated/configured by the kernel apply. The vendor and Joshua Riek's images do not have this problem. That's why I think the issue might be in this project (Armbian's linux-rockchip kernel).

Here is the Linux kernel documentation about threads-max:
https://www.kernel.org/doc/html/latest/admin-guide/sysctl/kernel.html#threads-max

I have been writing to the forums about this issue here:
https://forum.armbian.com/topic/48254-solution-for-browser-and-other-applications-crashing-due-to-processthread-limit/

@sdeleeuw
Copy link
Author

This is more reasonable configuration (Orange Pi 5, Joshua Riek's Ubuntu image)

# Orange Pi 5
sander@orangepi5:~$ cat /proc/sys/kernel/threads-max 
61133

sander@orangepi5:~$ ulimit -u
30566

@sdeleeuw
Copy link
Author

@nyanmisaka @amazingfate

Tested a manual build after pulling in the merged changes (in armbian/build), and the issue has been resolved.
Thanks a lot. This issue is now closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant