/etc/security/limits.conf가 적용되지 않음

/etc/security/limits.conf가 적용되지 않음

가 있는데 /etc/security/limits.conf적용되지 않은 것 같습니다.

a soft nofile 1048576 # default: 1024
a hard nofile 2097152
a soft noproc 262144  # default 128039
a hard noproc 524288  

내 사용자 이름은 어디에 있습니까? 및 를 a실행하면 다음이 표시됩니다.ulimit -Hnulimit -Sn

4096
1024

/etc/security/limits.d콘텐츠가 포함된 파일은 다음과 같습니다 .

scylla  -  core     unlimited
scylla  -  memlock  unlimited
scylla  -  nofile   200000
scylla  -  as       unlimited
scylla  -  nproc    8096

또한 해당 값을 추가한 다음 다시 시작하려고 시도했습니다 /etc/security/limits.conf.

echo '
session required pam_limits.so
' | sudo tee -a /etc/pam.d/common-session

하지만 작동하지 않았습니다. 내 OS는 Ubuntu 17.04.

답변1

https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu/1200818#_=_

우분투 16부터 버그가 있었던 것 같습니다.

원래:

  1. /etc/systemd/user.conf소프트 제한을 편집 하고 DefaultLimitNOFILE=1048576.
  2. 하드 제한을 편집 /etc/systemd/system.conf하고 DefaultLimitNOFILE=2097152.

신용은 다음과 같습니다@mkasberg.

답변2

그것을 추천합니다편집 하는 /etc/systemd/*.d/대신 직접 디렉토리를 생성합니다 ./etc/systemd/system.conf/etc/systemd/user.conf

  1. /etc/systemd/system.conf.d/limits.conf다음 내용으로 새 파일을 만듭니다 .

    [Manager]
    DefaultLimitNOFILE=1048576:2097152
    DefaultLimitNPROC=262144:524288
    
  2. systemctl daemon-reexec루트로 실행하십시오 .

  3. 로그아웃했다가 다시 로그인하세요.

  4. 최대 열린 파일 및 최대 프로세스에 대해 각각 ulimit -a또는 ulimit -n및 를 사용하여 새로운 제한을 확인하십시오 .ulimit -u

다음을 참조하세요.systemd-system.conf맨페이지자세한 내용은.

관련 정보