특정 대상 제외하고 조회

  • 조회
    • ls -p | grep -v '.tx' | grep -v '.rx'

반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,

멀티코더 CPU의 처리 성능 향상을 위해 아래와 같이 OS 부팅 파라메터인 NUMA 파라메터를 비활성할 수 있다.

NUMA 설정 변경 후 OS를 리부팅 해야 한다.


자세한 NUMA 파라메터 설명은 레드햇 사이트를 참조하기 바란다.


AUTOMATIC NUMA BALANCING

Automatic NUMA balancing improves the performance of applications running on NUMA hardware systems. It is enabled by default on Red Hat Enterprise Linux 7 systems.
An application will generally perform best when the threads of its processes are accessing memory on the same NUMA node as the threads are scheduled. Automatic NUMA balancing moves tasks (which can be threads or processes) closer to the memory they are accessing. It also moves application data to memory closer to the tasks that reference it. This is all done automatically by the kernel when automatic NUMA balancing is active.
Automatic NUMA balancing uses a number of algorithms and data structures, which are only active and allocated if automatic NUMA balancing is active on the system:
  • Periodic NUMA unmapping of process memory
  • NUMA hinting fault
  • Migrate-on-Fault (MoF) - moves memory to where the program using it runs
  • task_numa_placement - moves running programs closer to their memory

9.2.1. Configuring Automatic NUMA Balancing

Automatic NUMA balancing is enabled by default in Red Hat Enterprise Linux 7, and will automatically activate when booted on hardware with NUMA properties.
Automatic NUMA balancing is enabled when both of the following conditions are met:
  • # numactl --hardware shows multiple nodes, and
  • # cat /sys/kernel/debug/sched_features shows NUMA in the flags.
Manual NUMA tuning of applications will override automatic NUMA balancing, disabling periodic unmapping of memory, NUMA faults, migration, and automatic NUMA placement of those applications.
In some cases, system-wide manual NUMA tuning is preferred.
To disable automatic NUMA balancing, use the following command:
# echo 0 > /proc/sys/kernel/numa_balancing
To enable automatic NUMA balancing, use the following command:
# echo 1 > /proc/sys/kernel/numa_balancing


반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,

1. FIN Time Wait 세션 확인

프로그램이 수행될 때 netstat -nt | grep TIME_WAIT | wc -l 명령어를 통해 세션상태를 확인하여 TIME_WAIT 상태의 세션의 개수를 확인할 수 있다.

TIME_WAIT 상태 해제되지 않은 대량의 연결 시도가 로컬 포트에 할당되고 해제되지 않아 유효한 범위의 포트 번호를 잠식하여 발생한다.
할당된 포트가 해제될 때 까지 새로운 연결을 설정할 수 없게 하는 상황이 발생된다.추측하여 이런 저런 검색을 통해

2. FIN Time Wait 시간 조절

 sysctl.conf 에 아래 파라미터들을 추가하여 TIME_WAIT 을 발생시키던 세션수가 감소하는 것을 확인할 수 있다.
추가한 파라미터 및 역할을 아래와 같다. 
 . ip_local_port_range :: 로컬 포트로 사용할 수 있는 주소의 범위 
 . tcp_tw_recycle : TIME_WAIT 상태에 있는 연결을 빠르게 재활용 할 수 있도록 하기 위한 값,  기본적으로 비활성화 되어 있으므로 값을 추가하여 넣어줘야 함 
 . tcp_fin_timeout FIN_WAIT2 상태에 있는 보유 시간 설정 (기본 60초 -> 10초)
# vi /etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 10

3. 시스템에 적용하기

내용 추가 후 sysctl -p 명령어를 통해 바로 적용할 수 있다. 

※유의사항

net. ipv4 .tcp_tw_recycle을 사용하면 조건에 따라 TCP 세션 이 부풀어 없게되는 문제가 발생할 수도있다고 하니 관리하는 시스템 성격에 따라 유의하여 적용해야 할 것 같다. 


반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,

1. 개요

last 명령어로 최근 접속 기록 및 최근 재부팅 기록을 볼 수 있다.

/var/log/wtmp의 내용을 보여주는 것이다.

[root@zetawiki ~]# last

root pts/1 :0.0 Sun Feb 12 05:55 still logged in root pts/0 :0.0 Sun Feb 12 03:50 still logged in root pts/0 :0.0 Mon Feb 6 04:49 - 05:28 (00:38) root :0 Mon Feb 6 04:49 still logged in root :0 Mon Feb 6 04:49 - 04:49 (00:00) reboot system boot 2.6.18-274.el5 Mon Feb 6 13:32 (5+16:52)


wtmp begins Mon Feb 6 13:32:07 2012


2. 특정 계정 접속 확인


last 명령어 뒤에 계정명을 붙이면 그 계정의 접속 기록만 볼 수 있다.

[root@zetawiki ~]# last root

root pts/1 :0.0 Sun Feb 12 05:55 still logged in root pts/0 :0.0 Sun Feb 12 03:50 still logged in root pts/0 :0.0 Mon Feb 6 04:49 - 05:28 (00:38) root :0 Mon Feb 6 04:49 still logged in root :0 Mon Feb 6 04:49 - 04:49 (00:00)


wtmp begins Mon Feb 6 13:32:07 2012


3. 특정 시각 이전 접속 확인

-t 옵션으로 일시를 붙이면 그 이전의 접속기록만 표시된다. 

인수는 YYYMMDDHHMMSS(연월일시분초) 형식으로 적어야 한다.

[root@zetawiki ~]# last -t 20120212040000root pts/0 :0.0 Sun Feb 12 03:50 still logged in root pts/0 :0.0 Mon Feb 6 04:49 - 05:28 (00:38) root :0 Mon Feb 6 04:49 still logged in root :0 Mon Feb 6 04:49 - 04:49 (00:00) reboot system boot 2.6.18-274.el5 Mon Feb 6 13:32 (5+17:05)


wtmp begins Mon Feb 6 13:32:07 2012


4. 연도 보기

[root@zetawiki ~]# last

root pts/1 135.79.24.68 Thu Apr 7 10:28 still logged in root pts/1 135.79.24.68 Thu Apr 7 10:17 - 10:22 (00:05) root pts/0 135.79.24.68 Wed Aug 27 18:46 - 18:51 (00:05) ... (생략)

[root@zetawiki ~]# last -F

root pts/1 135.79.24.68 Thu Apr 7 10:28:58 2016 still logged in root pts/1 135.79.24.68 Thu Apr 7 10:17:39 2016 - Thu Apr 7 10:22:53 2016 (00:05) root pts/0 135.79.24.68 Wed Aug 27 18:46:54 2014 - Wed Aug 27 18:51:54 2014 (00:05)... (생략)


5. 지난달 기록 보기


이번달 기록만 나오는 경우가 있는데, /var/log/wtmp가 logrotate에 의해 순환된 경우에 그렇다.

흔히, 매달 1일에 특정 개수가 넘으면 순환되도록 설정되어 있다. 

→ /etc/logrotate.conf 참조


과거 기록을 보려면 확장자가 .1.2과 같이 보존된 파일을 열어봐야 한다.

last -f /var/log/wtmp.1


반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,

0. 환경

OS: RHEL 7.0 이상


1. 방화벽 오픈

sudo firewall-cmd --permanent --zone=public --add-port=20/tcp

sudo firewall-cmd --permanent --zone=public --add-port=21/tcp


2. 방화벽 설정 로딩 적용

sudo firewall-cmd --reload



3. 방화벽 상태 조회

sudo firewall-cmd --state


4. 방화벽 활성화 및 시작

sudo systemctl enable firewalld

sudo systemctl start firewalld


5. 방화벽 중지 및 비활성화

sudo systemctl stop firewalld

sudo systemctl disable firewalld



반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,

1. 환경

    • OS: RHEL 7.0 이상

2. SELINUX ftp 데몬 외부 접근 권한 설정

    • setsebool -P ftpd_full_access on


3. SELINUX ftp 상태 조회


    • getsebool -a | grep ftp


4. SELINUX 상태 조회


    • sestatus


반응형
블로그 이미지

조이풀 라이프

Lift is short, enjoy the life

,