[ LINUX ] drop_caches memory ~~ 메모리 찾기~~ 용-ILE/LINUX/AIX / HP / SOLARIS2011. 2. 17. 17:50
http://suite.tistory.com 2011.2 fs
1. 상황 현재 프로세스도 없는데 메모리가 20% -> 80%가 된경우가 있다.
$> sar -r 실행
01시쯤부터 cache 메모리가 확 줄어들고 있음
해당 시간때에 파일 읽기 많은 프로세스가 실행되었된것으로 보임(로그 확인으로 특이한 프로세스가 수행중이었음)
$> free -k 결과 buffers 에 6G 정도있고 cached에는 1G 내외였음 시간이 흐르면서 cached는 계속 늘어나고있음
2. 확인 사항
$> ps -ef , ps aux , top 으로 모니터링 해도 메모리를 많이 잡고 있는 process 는 없음
$>cat /proc/meminfo 수행 결과 (slab 메모리가 다른 서버에 비해 많음)
MemTotal: 8166480 kB
MemFree: 87520 kB
Buffers: 412972 kB
Cached: 1436408 kB
SwapCached: 5320 kB
Active: 2861672 kB
Inactive: 507492 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 8166480 kB
LowFree: 87520 kB
SwapTotal: 4192956 kB
SwapFree: 4174184 kB
Dirty: 352 kB
Writeback: 0 kB
Mapped: 1551948 kB
Slab: 4674220 kB
CommitLimit: 8276196 kB
Committed_AS: 4289248 kB
PageTables: 12016 kB
VmallocTotal: 536870911 kB
VmallocUsed: 264492 kB
VmallocChunk: 536606199 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
-$> slabtop 실행 결과
Active / Total Objects (% used) : 7824739 / 8227380 (95.1%)
Active / Total Slabs (% used) : 1168335 / 1168343 (100.0%)
Active / Total Caches (% used) : 87 / 131 (66.4%)
Active / Total Size (% used) : -196427.88K / 35872.14K (-547.6%)
Minimum / Average / Maximum Object : 0.02K / 0.00K / 128.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
4805590 4507678 93% 0.72K 961118 5 3844472K ext2_inode_cache
2863088 2810478 98% 0.23K 178943 16 715772K dentry_cache
$> cat /proc/slabinfo 실행 결과 inod cache를 많이 사용하는걸로 보임
...
ext2_inode_cache 4507680 4805590 736 5 1 : tunables 54 27 8 : slabdata 961118 961118 0
...
dentry_cache 2810526 2863088 240 16 1 : tunables 120 60 8 : slabdata 178943 178943 0
3. 조치 해본것
참조 구글링 : http://linux-mm.org/Drop_Caches
To free pagecache:
#echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
# echo 2 > /proc/sys/vm/drop_caches
-> 수행결과 메모리 다소 상승 됨 , 서버 문제없음
To free pagecache, dentries and inodes:
#echo 3 > /proc/sys/vm/drop_caches
-> 수행결과 서버 hang 발생했음 ~.~
(https://bugzilla.redhat.com/show_bug.cgi?id=449381)
-> 결론적으로 운영중인 시스템에 drop_caches 조정은 위험해~~~
* 캐쉬를 단기간에 제거할려면 일정잡고 재부팅이 최선일수도 .... or vm.vfs_cache_pressure 설정값을 크게 변경
* 조치 안해도 계속두면 시스템이 알아서 cached쪽이 늘어남(vm.vfs_cache_pressure 설정에 따라 그런것 같음)
'용-ILE > LINUX/AIX / HP / SOLARIS' 카테고리의 다른 글
빨간모자 계열 이더넷 eth config 참고용 (0) | 2012.09.26 |
---|---|
[ Sun-OS 10 ] Sendmail 8.13.7 Relay 설정 .. 기타 resolve.conf~~ (0) | 2009.05.28 |
[AIX 5.3] gcc 3.3.2 rpm 설치 하고 ld: 0706-006 .... ld:open() 에러~~사항 (0) | 2009.05.13 |
grep 하위 디렉토리 까지 조회시 -r 옵션 안될경우 (0) | 2008.07.25 |
[unix] 프로세스 사용량 보기 - 맞을려나??/ (0) | 2008.05.15 |