Search code examples
serverdebianulimit

Hitting ulimit on Debian11 with vite build (and others)


I am getting multiple error messages in different places that all hint towards somehow limiting ressources.

I have a vuejs application on a server, running vite build can occasionally (not always) fail with

runtime: failed to create new OS thread (have 6 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

Having a node.js application and running multiple commands in a build chain with npm-run-all and the following commands executed rimraf eslint tsc will always timeout the current bash session with error

bash: fork: retry: resource temporarily unavailable

The same error occurs, when trying to connect to the server via VS Code Remote. This error blocks all ssh connections of every user.

My current setup:

  • 8GB RAM
  • 4CPU vCore
  • 300GB SSD
  • Virtualization with Virtuozzo
  • Debian 11

Installed Software on the Server:

  • MySQL 8.0
  • Nginx
  • Node.js 16.15
  • Python 3.9 (Pillow, pip3, python-is-python3)
  • ufw, certbot, pm2, phpmyadmin

I have read already tried editing ulimits and what not

  • ulimit -u: 65535
  • threads-max: 2058672
  • ps -eLf | wc -l: 103

I have already set ulimit -Sn unlimited && ulimit -Sl unlimited.


The full system already runs on a similar server with similar specs and no problems - so I am guessing, something is wrong with the configuration rather then the programs/projects that I am trying to run.


Solution

  • As it turns out, this was due to this server being a virtual private server running on the virtualization platform virtuozzo. Same configuration with the kvm virtualization resulted in no error.

    This was later on also confirmed by the hosting company but not further detailed why this was happening