사용자 도구

사이트 도구


linux:performance

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:performance [2019/03/07 14:50]
kwon37xi
linux:performance [2023/04/29 14:08] (현재)
kwon37xi [vm.max_map_count]
줄 1: 줄 1:
 ====== Linux Performance ====== ====== Linux Performance ======
 +  * [[linux:perf|perf]]
   * [[https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/index.html|Performance Tuning Guide - Red Hat Customer Portal]] [[http://happy20hours.blogspot.kr/2012/09/linux-performance-and-tuning-guidelines.html|한국어 요약]]   * [[https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/index.html|Performance Tuning Guide - Red Hat Customer Portal]] [[http://happy20hours.blogspot.kr/2012/09/linux-performance-and-tuning-guidelines.html|한국어 요약]]
   * [[https://access.redhat.com/site/documentation/ko-KR/Red_Hat_Enterprise_Linux/6/pdf/Performance_Tuning_Guide/Red_Hat_Enterprise_Linux-6-Performance_Tuning_Guide-ko-KR.pdf|Redhat 6 Performance Tuning Guide]]   * [[https://access.redhat.com/site/documentation/ko-KR/Red_Hat_Enterprise_Linux/6/pdf/Performance_Tuning_Guide/Red_Hat_Enterprise_Linux-6-Performance_Tuning_Guide-ko-KR.pdf|Redhat 6 Performance Tuning Guide]]
줄 28: 줄 29:
  
 AWS 인스턴스의 경우 명시적으로 지정하지 않으면 아예 swap 공간을 만들지 않으므로 swappiness가 의미가 없는 듯. AWS 인스턴스의 경우 명시적으로 지정하지 않으면 아예 swap 공간을 만들지 않으므로 swappiness가 의미가 없는 듯.
 +
 +===== vm.max_map_count =====
 +  * 리눅스에서 [[linux:wine|Linux Wine]] 혹은 [[linux:steam|Steam]] 게임 혹은 [[search:elasticsearch|Elastic Search]] 서버 설정을 위해 필요할 수 있음.
 +  * 게임용도로는 ''vm.max_map_count=2147483642'' (''MAX_INT - 5'')
 +  * [[search:elasticsearch|Elastic Search]]는 최소 ''vm.max_map_count=262144'' 가 필요함. [[https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html|Virtual memory | Elasticsearch Guide | Elastic]]
 +<code sh>
 +sudo sysctl -w vm.max_map_count=2147483642
 +</code>
 +  * ''/etc/sysctl.d/99-vm-max-map-count.conf'' 파일을 만들어서 내용을 추가하면 부팅시 자동적용
 +<code>
 +vm.max_map_count=2147483642
 +</code>
 +  * [[https://www.youtube.com/watch?v=PsHRbfZhgXM&ab_channel=BrodieRobertson|Fedora 39 Changes 1 Line Saving Hours Of Pain - YouTube]] : Fedora 39 에서 기본값으로 ''2147483642'' 적용될 수 있음.
 ===== nproc(Max User Processes) ===== ===== nproc(Max User Processes) =====
   * ''ulimit -u'' 명령으로 값을 볼 수 있다.   * ''ulimit -u'' 명령으로 값을 볼 수 있다.
줄 43: 줄 57:
  
 ===== limits.conf ===== ===== limits.conf =====
 +  * [[https://www.cubrid.com/tutorial/3794180|CUBRID | 튜토리얼 - 리소스를 제한(limits.conf) 하여 DB서버를 관리하자]]
 +  * ''/etc/security/limits.conf'' 혹은 ''/etc/security/limits.d/*.conf'' 로 파일 생성
 +  * ''soft''에 다다르면 경고, ''hard''는 절대로 해당값 이상으로는 설정할 수 없다.
 +  * 계정명은 ''*'' 이면 전체 계정
 <code> <code>
 계정명         soft    nofile          50000 계정명         soft    nofile          50000
줄 62: 줄 80:
 </code> </code>
   * [[http://woowabros.github.io/experience/2018/04/17/linux-maxuserprocess-openfiles.html|Java, max user processes, open files - 우아한형제들 기술 블로그]]   * [[http://woowabros.github.io/experience/2018/04/17/linux-maxuserprocess-openfiles.html|Java, max user processes, open files - 우아한형제들 기술 블로그]]
 +
 +===== systemd 사용시의 limits 설정 =====
 +  * [[linux:systemd|systemd]]를 사용하고 GUI 로그인을 하거나(non GUI 로그인은 무관), systemd 서비스들의 경우에는 ''limits.conf''가 적용이 안 된다.
 +  * [[https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu/|linux - Cannot Increase open file limit past 4096 (Ubuntu) - Super User]]
 +  * [[https://man.archlinux.org/man/systemd-system.conf.5|systemd-system.conf(5) — Arch manual pages]] 
 +  * ''/etc/systemd/system.conf'', ''/etc/systemd/user.conf'', ''/etc/systemd/system/unit.d/override.conf'' , ''/etc/systemd/user.conf.d/원하는파일.conf'' 등을 사용해서 설정해야 한다.
 +  * ''/etc/systemd/user.conf.d/99-user-system-limits.conf'' 를 통한 각 사용자의 limit 설정
 +
 +<code>
 +[Manager]
 +DefaultLimitNOFILE=50000
 +DefaultLimitNPROC=10000
 +</code>
 +<code sh>
 +$ ulimit -n -u
 +open files                          (-n) 50000
 +max user processes                  (-u) 10000
 +</code>
 ===== Outbound Socket Connection ===== ===== Outbound Socket Connection =====
   * [[http://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux|limit - Increasing the maximum number of tcp/ip connections in linux - Stack Overflow]]   * [[http://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux|limit - Increasing the maximum number of tcp/ip connections in linux - Stack Overflow]]
줄 82: 줄 118:
   * [[http://meetup.toast.com/posts/55|리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 - 3편 : TOAST Meetup]]   * [[http://meetup.toast.com/posts/55|리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 - 3편 : TOAST Meetup]]
   * [[https://www.slideshare.net/brendangregg/performance-tuning-ec2-instances|Performance Tuning EC2 Instances]]   * [[https://www.slideshare.net/brendangregg/performance-tuning-ec2-instances|Performance Tuning EC2 Instances]]
 +  * [[https://haydenjames.io/linux-server-performance-disk-io-slowing-application/|Linux server performance: Is disk I/O slowing your application?]]
linux/performance.1551937805.txt.gz · 마지막으로 수정됨: 2019/03/07 14:50 저자 kwon37xi