'PDO Connection Error: SQLSTATE[HY000]  Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
error when I'm trying to make too much update and insert. With too much update, I mean 20k-30k transaction per minute. For example, when I try to make a batch processing over 10k records in a table, I'm starting to get this error.
I searched in serverfault and MySQL reference docs, and I found, invalid sock file location or down mysql server can cause this error, but my sock files path is true and mysql server is up. Because normally, I'm able to connect to mysql and run query.
Can connection limit cause this error? My current max_connections variable value is 151, and this can be not enough for 10k transactions per minutes. But as I know, when too much connections opened to mysql, it gives too many connections error not can't connect through socket error.
I have changed, my application to to use mysql_pconnect instead of mysql_connect. I don't know what will happen when I try to run cron job to process 10k records.
Do you have any idea? If I can't found a answer for this problem, I will try to get a big machine for MySQL with 32 gb ram, 4-8 processors and try with this setup.