question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create more than max_prepared_stmt_count statements

See original GitHub issue

When my server runs for a period of time, this prompt appears.

"can't create more than max_prepared_stmt_count statements".

I checked the status of MySQL and got the following results:

mysql> SHOW GLOBAL STATUS LIKE 'com_stmt%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| Com_stmt_execute        | 6512872 |
| Com_stmt_close          | 0       |
| Com_stmt_fetch          | 0       |
| Com_stmt_prepare        | 18313   |
| Com_stmt_reset          | 0       |
| Com_stmt_send_long_data | 0       |
| Com_stmt_reprepare      | 0       |
+-------------------------+---------+
mysql> show variables like "%prepared%";
+------------------------------------------------------+-------+
| Variable_name                                        | Value |
+------------------------------------------------------+-------+
| max_prepared_stmt_count                              | 16382 |
| performance_schema_max_prepared_statements_instances | -1    |
+------------------------------------------------------+-------+

My friend suggested that I can modify mysql’s ‘max_prepared_stmt_count’ to a higher value.I checked the sequelize code and found that the connection pool was just ‘closed’ connection, does not close PreparedStatement.Is there any API can solve this or only can be modifying ‘max_prepared_stmt_count’.very thanks.

Environment

Dialect:

  • mysql Sequelize version: 5.3.5 Database version: 8.0.15 Node Version: v10.3.0 OS: Centos 7.5 TypeScript version: 3.4.3

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:12
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
alexandrulucacommented, Feb 23, 2020

Any updates on this? I had the exact same problem on a production server

2reactions
bsapotcommented, Aug 21, 2019

Yes, this seems to have fixed the issue the first person was having which is the problem we had. We deployed it to production earlier today and it is working well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySqli Error: Can't create more than ...
As the question is not clear. I will post some ways to avoid this mysql error: Check your client code, you should close...
Read more >
Can't create more than max_prepared_stmt_count statements
Short answer: increase max_prepared_stmt_count in MySQL server. Long answer: Many applications, including Laravel, make a terrible use of ...
Read more >
Can't create more than max_prepared_stmt_count statements ...
I have Temporal deployed using the latest helm chart (v 1.17.4) with MySQL as its persistence store. I'm periodically seeing the following ...
Read more >
How max_prepared_stmt_count can bring down production ...
From MySQL's Doc,. This variable limits the total number of prepared statements in the server. It can be used in environments where there...
Read more >
Can't create more than max_prepared_stmt_count statements
16 , and I have no longer this issue by increasing max_prepared_stmt_count statements to the mysql config directly in the server. Thx for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found