cat /etc/my.cnf | grep limit --没有设置open_files_limit
# open-files-limit = 3000
[root@db10-091 ~]# ulimit -n --为什么看root用户的ulimit,之前已经讲过原因。
40000
场景一:
+--------------------+-------+
+--------------------+-------+
+--------------------+-------+
1 rows in set (0.01 sec)
+------------------+-------+
+------------------+-------+
+------------------+-------+
1 row in set (0.00 sec)
场景二:
+-----------------+-------+
+-----------------+-------+
+-----------------+-------+
1 row in set (0.00 sec)
+------------------+-------+
+------------------+-------+
+------------------+-------+
1 row in set (0.00 sec)
结果是: open_files_limit=50000
计算方式: 当open_files_limit没有被配置的时候,比较max_connections*5和ulimit -n的值,哪个大用哪个