在项目中遇到了数据导入特别缓慢的问题、或者是建立索引特别慢。
在优化数据库无果之后,主机方面找到了问题的原因。
就是这个东西。
- [root@rac1 ~]# netstat -nai
- Kernel Interface table
- Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
- eth0 1500 0 9202 0 0 0 7764 0 0 0 BMRU
- eth0:1 1500 0 - no statistics available - BMRU
- eth1 1500 0 414357 0 0 0 330398 0 0 0 BMRU
- eth1:1 1500 0 - no statistics available - BMRU
- lo 16436 0 99564 0 0 0 99564 0 0 0 LRU
- [root@rac1 ~]#
它控制了每个网络传输的最大的数据包的大小,如果这个值设置的不合理就会导致数据包频繁的拆包和发送,导致网络负载相当高,从而影响数据库性能。
可以使用PING大包的方式去测试这个值。
- [root@rac2 ~]# ping -s 65507 rac1
- PING rac1 (192.168.137.128) 65507(65535) bytes of data.
- 65515 bytes from rac1 (192.168.137.128): icmp_seq=1 ttl=64 time=1.03 ms
- 65515 bytes from rac1 (192.168.137.128): icmp_seq=2 ttl=64 time=1.84 ms
- 65515 bytes from rac1 (192.168.137.128): icmp_seq=3 ttl=64 time=1.29 ms
- ^C
- --- rac1 ping statistics ---
- 3 packets transmitted,3 received,0% packet loss,time 2927ms
- rtt min/avg/max/mdev = 1.032/1.390/1.846/0.340 ms
- [root@rac2 ~]# ping -s 65508 rac1
- WARNING: packet size 65508 is too large. Maximum is 65507
- PING rac1 (192.168.137.128) 65508(65536) bytes of data.
- ping: local error: Message too long,mtu=1500
- ping: local error: Message too long,mtu=1500
- ^C
- --- rac1 ping statistics ---
- 2 packets transmitted,0 received,+2 errors,100% packet loss,time 1913ms
- [root@rac2 ~]#
因为一般一个ORACLE RAC要和存储节点去通信,所以MTU值最好是对等状态,最优经验值是7000。