Open VladRodionov opened 10 years ago
Some code can be found in Hadoop NativeIO. As since we are running under Hadoop anyway, its good to re-use existing library.
For Linux DIRECT IO we can try the following:
fcntl(fd, F_SETFL, flags | O_DIRECT) -set O_DIRECT flag for already opened file http://linux.die.net/man/2/fcntl
Another option: limit page cache size:
It can be done on SUSE: (see SUSE) It can be done in RH/Centos: echo '1' > /proc/sys/vm/pagecache (?)
Linux page cache is evil, especially when it grows unbounded.
I did initial code check in. This 'bypass page cache' works on Mac OSX, but not on Linux yet.
We do not need page cache for SSD at all. SOme other perf tips:
SSD optimization tips