Linux환경에서 SSD 성능 최적화하기 2

1.
지난Linux환경에서 SSD 성능 최적화하기에 이어지는 글입니다.

Btrfs와 EXT4를 비교하면서 ‘EXT4와 Btrfs가 비슷한 성능을 보여준다’고 지난 글에서 정리하였습니다. 그렇지만 조건이 하나 붙으면 완전히 다른 결과가 나옵니다. Btrfs의 성능을 압축기능을 사용했을 때와 아닐 때 그리고 압축알고리즘을 LZO와 GZip을 사용했을 때를 서로 비교해도록 하죠. LZO를 사용하면 아주 탁월한 성능을 보여줍니다.

Btrfs LZO Compression Performance

그러면 EXT4와 비교하면 어떤 결과를 보여줄까요? 열시 Phoronix가 시험한 결과입니다.

EXT4에 비해 4배이상의 성능을 SSD에서 보여줍니다.

2.
Btrfs라는 파일시스템이 궁금해집니다. Btrfs(B-tree file system 또는 Butter file system)는 현재 오라클의 크리스 메이슨이 개발을 지휘하고 있는 파일시스템이라고 합니다. 오라클이 소개하는 특징은 다음과 같습니다.

Btrfs(B-tree file system 또는 Butter file system[1])는 파일 시스템 가운데 하나로 현재 오라클 코퍼레이션의 크리스 메이슨이 개발을 지휘하고 있다. 아직 많은 개발이 필요한 상태에 있어 일상적으로 사용하기에는 적합하지 않다.

The Btrfs file system provides the following advanced capabilities:

Supports large files and file systems
Offers integrated volume management
Has built-in RAID functionality
Keeps data secure using copy-on-write and checksumming techniques
Provides writable snapshots

Performance Enhancements: Btrfs provides functionality and device support designed to improve file system performance characteristics.

Solid-state disk support. Flash memory, such as the memory cards we put in our digital cameras and the removable USB drives we use to back up and transport data from one machine to another, is low-cost, nonvolatile computer memory that can be electrically erased and reprogrammed. In the enterprise, Flash technology is used in solid-state disk drives (SSDs) to increase application performance. Btrfs is SSD-aware, avoids unnecessary seek optimization, and aggressively sends writes in clusters, even if they are from unrelated files. This results in larger write operations and faster write throughput.
How I Got Started with the Btrfs File System for Oracle Linux중에서

매주 좋은 기능을 가졌습니다. 그렇지만 리눅스 커널개발자들은 The Not-Ready Btrfs and ExFAT Linux Filesystems 처럼 아직은 미성숙한 파일시스템으로 바라 보고 있습니다. 이 또한 논쟁중입니다.

그래서 이런 결론은 내려봅니다. Linux중 특정한 파티션만을 Btrfs로 만들어 사용합니다. 예를 들면 /var/log 혹은 $APPLICATION_HOME/log와 같이 트레이딩시스템의 로그만을 Btrfs를 적용하는 것입니다. 그러면 안전하면서도 더 나은 속도를 기대할 수 있지않을까요?

3.
혹 Btrfs에 도전하려면 아래를 출발점으로 하시면 좋습니다.

BTRFS Fun

압축을 이용하여 Btrfs를 사용하려면 아래와 같이 합니다.

btrfs file systems can make use of zlib (default) and lzo compression which means that compressible files will be stored in compressed form on the hard drive which saves space. zlib has a higher compression ratio while lzo is faster and takes less cpu load. Using compression, especially lzo compression, can improve the throughput preformance. Please note that btrfs will not compress files that have already been compressed ar application level (such as videos, music, images, etc.).
A Beginner’s Guide To btrfs중에서

마지막으로 EXT4 파일 시스템을 Btrfs 파일 시스템으로 변환하려면 아래와 같이 합니다.

1. 만일의 사태에 대비해서 데이타를 백업합니다.
2. # sudo yum install btrfs-progs 명령어로 btrfs 꾸러미를 설치합니다.
3. 설치 CD 를 이용 rescue 모드로 재부팅해 줍니다. 혹은 다른 Live 리눅스를 이용합니다.
– 물론 시스템의 파일 시스템이 아닌 경우에는 umount 를 하고 진행하면 됩니다.
4. 설치 CD 또는 다른 Live 리눅스에서 btrfs-progs 에 있는 “btfs-convert” 명령어를 사용할 수 있도록 준비합니다.
5. # btrfs-convert <디바이스명> 명령어를 수행하여 변환합니다.
– /boot 파티션은 btrfs 로 변경하면 안됩니다.
6. # blkid <디바이스명> 명령어를 수행하여 UUID를 확인하고 /etc/fstab, /boot/grub/grub.conf 파일을 수정해 줍니다.
7. 만일 문제가 발생하면 설치 CD 및 Live 리눅스를 이용하여 # btrfs-convert -r <디바이스명> 명령어를 이용하여 rollback 을 합니다.
8. 문제가 없이 완료된 경우 이전 파일 시스템의 snapshot 을 아래의 명령어를 삭제합니다.
# btrfs subvolume delete /ext2_saved
EXT4 파일 시스템을 Btrfs 파일 시스템으로 변환하기 중에서

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.