libioil
라이브러리는 libc를 사용하는 애플리케이션에서 DFuse에 대한 읽기 및 쓰기 작업의 성능을 개선하는 데 사용할 수 있습니다. 이 라이브러리는 애플리케이션의 POSIX 읽기 및 쓰기 호출을 가로채고 사용자 공간에서 직접 처리하여 커널을 우회합니다.
libioil 사용
가로채기 라이브러리를 사용하려면 LD_PRELOAD
를 DAOS 설치 디렉터리의 공유 라이브러리로 가리키도록 설정합니다.
LD_PRELOAD=/usr/lib64/libioil.so
예를 들면 다음과 같습니다.
$ dd if=/dev/zero of=./foo bs=1G count=20
20+0 records in
20+0 records out
21474836480 bytes (21 GB, 20 GiB) copied, 14.1946 s, 1.5 GB/s
$ LD_PRELOAD=/usr/lib64/libioil.so dd if=/dev/zero of=./bar bs=1G count=20
20+0 records in
20+0 records out
21474836480 bytes (21 GB, 20 GiB) copied, 5.0483 s, 4.3 GB/s
-lioil
플래그를 사용하여 컴파일 시 애플리케이션을 가로채기 라이브러리와 연결할 수도 있습니다.
활동 모니터링
가로채기 라이브러리의 활동 보고서를 사용 설정하려면 D_IL_REPORT
환경 변수를 설정합니다. 이는 일반적으로 프로그램 종료 시 공유 라이브러리 소멸자의 활동을 간단히 요약하여 반환합니다.
D_IL_REPORT
에 할당된 값은 stderr에 로깅할 읽기 및 쓰기 호출 수를 정의합니다. 모든 호출을 로깅하려면 값을 -1
로 설정합니다. 프로그램 종료 시만 요약을 출력하려면 값을 0
로 설정합니다.
예를 들면 다음과 같습니다.
$ D_IL_REPORT=1 LD_PRELOAD=/usr/lib64/libioil.so dd if=/dev/zero of=./bar bs=1G count=20
[libioil] Intercepting write of size 1073741824
20+0 records in
20+0 records out
21474836480 bytes (21 GB, 20 GiB) copied, 5.17297 s, 4.2 GB/s
$ D_IL_REPORT=3 LD_PRELOAD=/usr/lib64/libioil.so dd if=/dev/zero of=./bar bs=1G count=5
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
5+0 records in
5+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 1.27362 s, 4.2 GB/s
$ D_IL_REPORT=-1 LD_PRELOAD=/usr/lib64/libioil.so dd if=/dev/zero of=./bar bs=1G count=5
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
[libioil] Intercepting write of size 1073741824
5+0 records in
5+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 1.29935 s, 4.1 GB/s
coreutils
패키지의 대부분의 GNU 유틸리티를 비롯한 일부 프로그램에는 종료 시 stderr를 닫는 소멸자 함수가 있습니다. 즉, 가로채기 라이브러리는 cp 및 cat과 같은 많은 기본 명령어에 작동하지만 가로채기 라이브러리에서 생성된 요약은 볼 수 없습니다.