在Oracle 11g中引入了Direct Network File System(Oracle Direct NFS)的新特性,通过一个打包在Oracle内核中的NFS client来提高使用NFS时的性能,DNFS同样适用于RAC等高可用场景。
DIRECT NFS CLIENT OVERVIEW
Standard NFS client software, provided by the operating system, is not optimized for Oracle Database file I/O access patterns. With Oracle Database 11g, you can configure Oracle Database to access NFS V3 NAS devices directly using Oracle Direct NFS Client, rather than using the operating system kernel NFS client. Oracle Database will access files stored on the NFS server directly through the integrated Direct NFS Client eliminating the overhead imposed by the operating system kernel NFS. These files are also accessible via the operating system kernel NFS client thereby allowing seamless administration.Benefits of Direct NFS Client
Direct NFS Client overcomes many of the challenges associated with using NFS with the Oracle Database. Direct NFS Client outperforms traditional NFS clients, is simple Oracle Database 11g – Direct NFS Client
最近公司准备使用dnfs 作为测试数据库的存储模式,正好借机测试了一把。
具体环境为:
[root@DCA-SRV-0133 u01]# dmidecode -s system-product-name PowerEdge R905 [root@DCA-SRV-0133 u01]# cat /proc/meminfo |grep MemTotal MemTotal: 132352732 kB [root@DCA-SRV-0133 u01]# cat /proc/cpuinfo |grep processor |wc -l 24 [root@DCA-SRV-0133 u01]# cat /etc/issue Oracle Server release 5.8 Kernel \r on an \m 存储使用NETAPP 标准NAS结构 测试对比dnfs,nfs 性能指标,使用数据库版本11.2.0.3
setup by DNFS
1.mount nfs 文件
[root@DCA-SRV-0133 /]# showmount -e nas Export list for nas: /vol/vol0 192.168.254.0/24 /vol/vol_user_db 192.168.254.0/24,10.0.254.0/24 [root@DCA-SRV-0133 /]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 10.0.254.1 nas 10.63.0.221 DCA-SRV-0133 [root@DCA-SRV-0133 /]# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 101572540 3671028 92658704 4% / /dev/sda3 101572572 192352 96137408 1% /home tmpfs 66176364 0 66176364 0% /dev/shm /dev/sda4 878850916 14454200 819753688 2% /data 10.0.254.1:/vol/vol_user_db 1518128384 1821888 1516306496 1% /u01 [root@DCA-SRV-0133 /]# umount /u01/ [root@DCA-SRV-0133 /]# mount -t nfs 10.0.254.1:/vol/vol_user_db /u01 [root@DCA-SRV-0133 /]# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 101572540 3671056 92658676 4% / /dev/sda3 101572572 192352 96137408 1% /home tmpfs 66176364 0 66176364 0% /dev/shm /dev/sda4 878850916 14454200 819753688 2% /data 10.0.254.1:/vol/vol_user_db 1518128384 1821888 1516306496 1% /u01
2.配置数据库 dnfs
[oracle@DCA-SRV-0133 lib]$ cd $ORACLE_HOME/lib [oracle@DCA-SRV-0133 lib]$ mv libodm11.so libodm11.so.old [oracle@DCA-SRV-0133 lib]$ ln -s libnfsodm11.so libodm11.so [oracle@DCA-SRV-0133 lib]$ ls -l libodm11.so lrwxrwxrwx 1 oracle oinstall 14 Nov 22 16:03 libodm11.so -> libnfsodm11.so [oracle@DCA-SRV-0133 lib]$ ls -l libodm11.so lrwxrwxrwx 1 oracle oinstall 14 Nov 22 16:03 libodm11.so -> libnfsodm11.so [oracle@DCA-SRV-0133 lib]$ ls -l libodm11.so.old -rwxr-xr-x 1 oracle oinstall 60431 Nov 22 15:08 libodm11.so.old [oracle@DCA-SRV-0133 lib]$ cat $ORACLE_HOME/dbs/oranfstab server: nas local:10.0.254.21 ----->这里注意由于使用了网卡bind 使用了两个IP区分nfs 网络与IDC网络,需要手工指定local ip. path: 10.0.254.1 path: 192.168.254.1 ------------------- > MP export: /vol/vol_user_db mount: /u01 [oracle@DCA-SRV-0133 lib]$
3.startup database
SQL> startup ORACLE instance started. Total System Global Area 4.0486E+10 bytes Fixed Size 2237088 bytes Variable Size 3892317536 bytes Database Buffers 3.6507E+10 bytes Redo Buffers 84631552 bytes ..... Starting ORACLE instance (normal) ****************** Large Pages Information ***************** Total Shared Global Region in Large Pages = 0 KB (0%) Large Pages used by this instance: 0 (0 KB) Large Pages unused system wide = 0 (0 KB) (alloc incr 128 MB) Large Pages configured system wide = 0 (0 KB) Large Page size = 2048 KB .. Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0 Fri Nov 23 13:34:34 2012 PMON started with pid=2, OS id=18612 Fri Nov 23 13:34:34 2012 PSP0 started with pid=3, OS id=18616 Fri Nov 23 13:34:35 2012 VKTM started with pid=4, OS id=18620 at elevated priority VKTM running at (1)millisec precision with DBRM quantum (100)ms .. ORACLE_BASE from environment = /data/oracle Fri Nov 23 13:34:36 2012 ALTER DATABASE MOUNT Direct NFS: channel id [0] path [10.0.254.1] to filer [nas] via local [10.0.254.21] is UP Direct NFS: channel id [1] path [10.0.254.1] to filer [nas] via local [10.0.254.21] is UP Successful mount of redo thread 1, with mount id 2930804780 Database mounted in Exclusive Mode Lost write protection disabled Completed: ALTER DATABASE MOUNT
4. 使用swingbench 导入10g数据
4.1设置database sga 为5G .
DNFS performance 100 users:
AVG TPS 2222 AVG response time delay 40ms
NFS performance 100 users:
AVG TPS 1401 AVG response time delay 80ms
4.2 设置database sga 为 800M
DNFS performance 1000 users:
AVG TPS 578 AVG response time delay 1.5S
NFS performance 1000 users:
AVG TPS 400 AVG response time delay 2.0S
Other DNFS Best practice Performance:
nice, 性能提升明显