Hi Everyone,
I am having a frustrating issue. My web service has an email to php module. Briefly, once my user sends an email to his dedicated email address, my mail server captures the email, pipes it to a PHP script running on my server. This PHP script opens a MySQL connection and saves the email content to the database.
So far so good. The problem starts to occur once my MySQL connection limit set in /etc/my.cnf is exceeded. It's set to 500. If 500 or more users sends emails at the same time, my MySQL gets unable to handle new connections.
What do you suggest? Should I use a persistent MySQL connection or any other method like writing the received email content to a txt file and then saving them into the db with a cron job?
Thanks for your suggestions!