ulimit: open files: cannot modify limit: Operation not permitted
As seen in the Dockerfile, I’m trying to run this as a vespaUSER, which is the USER of the base image I’m using (according to docker inspect --format '{{.Config.User}}' vespaengine/vespa:8.277.17), following an advice I’ve read in a Vespa issue.
I’ve tried every solutions from previous community post I could find here that would be relevant to my case to edit ulimit, but to no avail. I would be grateful if someone could put me in the right direction.
Note that it runs as root, but then immediately switches to user aerial in the CMD.
I think this forces a PAM login, whereas USER aerial would instead be a Fly transmogrification, .
The limits.conf file is:
aerial hard nofile 20000
aerial soft nofile 20000
And the Ruby script just does a ton of opens—to demonstrate the new limit…
system("whoami")
system("bash -c 'ulimit -n'") # ...shows current limit; does not set.
# 10241 open file descriptors...
h= {}; (1..10241).each do |i|
if i > 10230
p i # ...show in log.
STDOUT.flush
end
h[i] = File.open('/dev/null')
end
sleep 1_000_000
It appears that Vespa is based instead on Red Hat, though, so additional tweaking may be required.