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

Debian 8.4 jessie ulimit issue: Operation not permitted. #3166

Closed
tholu opened this issue Apr 13, 2016 · 2 comments
Closed

Debian 8.4 jessie ulimit issue: Operation not permitted. #3166

tholu opened this issue Apr 13, 2016 · 2 comments

Comments

@tholu
Copy link

tholu commented Apr 13, 2016

When starting the redis-server on Debian 8.4, it cannot increase the maximum open files limit.

24401:M 13 Apr 13:50:01.156 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
24401:M 13 Apr 13:50:01.156 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
24401:M 13 Apr 13:50:01.156 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 24401
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

24401:M 13 Apr 13:50:01.156 # Server started, Redis version 3.0.7
24401:M 13 Apr 13:50:01.203 * DB loaded from disk: 0.046 seconds
24401:M 13 Apr 13:50:01.203 * The server is now ready to accept connections on port 6379

As root:

$ ulimit -n
65536

I guess it's because redis-server runs under the user redis on Debian. What is the preferred way to increase the maximum open files for non-root users on Debian?

@tholu tholu changed the title Debian 8.4 jessie ulimit issue: Debian 8.4 jessie ulimit issue Apr 13, 2016
@tholu tholu changed the title Debian 8.4 jessie ulimit issue Debian 8.4 jessie ulimit issue: Operation not permitted. Apr 13, 2016
@tholu
Copy link
Author

tholu commented Apr 13, 2016

Note: Version 3.0.7 was from dotdeb, issue is the same with 3.0.6 from Debian jessie backports.

@tholu
Copy link
Author

tholu commented Apr 13, 2016

Solution:

edit /lib/systemd/system/redis-server.service and add to the [Service] section the line (after: User=redis and Group=redis) LimitNOFILE=65536

run: systemctl daemon-reload && systemctl restart redis-server

Thanks to http://serverfault.com/questions/770037/debian-8-4-jessie-set-open-files-limit-for-redis-user/

@tholu tholu closed this as completed Apr 13, 2016
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