Rails 3.2.3 mysql error "max_prepared_stmt_count"
- by Rob Momary
I am running a Rails 3.2.3 app deployed with apache2/passenger on a virtual host with a mysql database server. I got this error after a lot of traffic was hitting the site:
ActiveRecord::StatementInvalid (Mysql::Error: Can't create more than
max_prepared_stmt_count statements (current value: 16382)
I'm thinking it has something to do with the amount of traffic, but if so I have to find a way around this. Anyone had this error before? I can't figure out how to stop it.
Here's what i see in mysql:
mysql show global status like 'com_stmt%';
| Com_stmt_close | 1720319
| Com_stmt_execute | 2094137 |
| Com_stmt_fetch | 0 |
| Com_stmt_prepare | 1768924 |
| Com_stmt_reprepare | 0 |
| Com_stmt_reset | 0 |
| Com_stmt_send_long_data | 0 |
+-------------------------+---------+
I am running resque gem.