혹시 FUSE파일시스템에 kernel_cache옵션 써보신분?
안녕하세요. FUSE파일시스템에 관해 해보고있는데요.
옵션중에 kernel_cache랑 direct_io가 있어서 시간 테스트 해서 둘이 서로 비교해보았는데..
차이가 별로 안나드라고요.
kernel_cache : cache files in kernel
direct_io : use direct I/O
kernel_cache 는 말 그대로 kernel_cache를 사용해서 더 빠른 속도를 내고
direct_io는 direct I/O를 사용해서 캐쉬를 쓰지 않고 바로 쓰고 지우고 하는거 같은데
속도 차이도 안나고.. 뭐가 어떻게 다른지 알 수가 없네요..-ㅅ-;;
위에 옵션 2개랑 옵션 안주고 테스트 해보니까.. 셋다 비슷한 시간결과를 내더군요...
비슷하다면.. 왜 저런 옵션을 만들어 놓았을까요..? ㄱ-
옵션 원문을 올려봅니다.
kernel_cache
This option disables flushing the cache of the file contents on
every open(). This should only be enabled on filesystems, where the
file data is never changed externally (not through the mounted FUSE
filesystem). Thus it is not suitable for network filesystems and
other "intermediate" filesystems.
NOTE: if this option is not specified (and neither 'direct_io') data
is still cached after the open(), so a read() system call will not
always initiate a read operation.
direct_io
This option disables the use of page cache (file content cache) in
the kernel for this filesystem. This has several affects:
- Each read() or write() system call will initiate one or more
read or write operations, data will not be cached in the
kernel.
- The return value of the read() and write() system calls will
correspond to the return values of the read and write
operations. This is useful for example if the file size is not
known in advance (before reading it).
direct_io는 바로
direct_io는 바로 동기화해줄 필요가 있는 데이터일 경우 자주 씁니다.
fuse로 ftp 업로드했을때 direct_io 안켜면 바로 업로드가 안되는것과 같은 원리죠.
Written By the Black Knight of Destruction
Written By the Black Knight of Destruction
음...
저도 Necromancer님과 같은 생각을 하고 있는데 direct_io를 써서 2번째 돌려도
속도가 빨리 나온다는게 좀 의심스럽네요.
1번째 돌릴때는 파일을 메모리로 로드 시키는데 시간이 걸렸지만
2번째 돌릴때는 이미 메모리 위에 있는 파일을 가지고 작업을 하기 때문에
첫번째에 비해 속도가 너무 빠르더라고요.
direct_io를 쓸 경우 캐쉬를 쓰지 않으니 메모리 위에 있는 파일은 안 쓰고 디스크에 있는 파일을 다시 로드 시킬거라고 생각했는데
결과를 보니 그게 아니더라고요..-ㅅ-;;
댓글 달기