每当对服务器的请求数量增加时,就会在Ruby On Rails应用程序中随机获取以下错误。
Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)):
我不确定这是因为服务器内存不足还是与mysql2 gem有关。
Ruby '2.5.0'
Rails '5.2.0
Mysql2 0.5.2
Phusion Passenger 5.3.4
Server version: Apache/2.4.6 (CentOS)
RAM SIZE: 1.5GB
MySQL Community Server (GPL): 5.6.41