-
Notifications
You must be signed in to change notification settings - Fork 961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create more than max_prepared_stmt_count statements #1251
Comments
Hi @seanlook . Short answer: increase Long answer: ProxySQL optimizes this, tracking all
This is true, ProxySQL does not close statements, never. Can you copy the output of |
Thanks, @renecannao
All my proxysql nodes show If I have high concurrency in a shot time, would not closing the prepared statement backend is a problem?
|
Thank you for the output.
Because
What can happen is that if you have a lot of connections, they will sum up. For example, if you have 20 prepared statements prepared in 80 connections, that is 16000 prepared statements (very close to the default limit To sum up:
|
Hi @renecannao , I appreciate it that let the user decide whether use the feature to boost performance or not. I eccounter the problem in production today again, and it's really a disaster for me. I had set Would you provide a parameter to disable or enable this kind of prepared statement behavior? |
@seanlook : disabling this feature is not an option right now, and isn't easy to implement. What is your current value of Re-opening the issue. |
The current value of There is 3 ProxySQL nodes connected to backend server.
I have restarted proxysql , so
|
3 nodes times 5000 But more than |
Hello Rene, How is it possible that Stmt_Server_Active_Total went all the way up to 16.5k:
When max amount of connections to all nodes would be 600 (3 nodes, 200 per node)
and max_stmts_per_connection was at default of 20
Sounds like it's leaking statements when resetting the connection? |
Hi, I'm running into this - also using Laravel/Eloquent - did you ever found a solution for this? Thank you |
Well, nvm, I found that setting 'connections' => [
'mysql' => [
'driver' => 'mysql',
'read' => [
'host' => env('DB_HOST_READ', env('DB_HOST', '127.0.0.1')),
'port' => env('DB_PORT_READ', env('DB_PORT', 3306)),
],
'write' => [
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', 3306),
],
'sticky' => true,
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => env('DB_PREFIX', ''),
'strict' => env('DB_STRICT_MODE', true),
'engine' => env('DB_ENGINE', null),
'timezone' => env('DB_TIMEZONE', '+00:00'),
'options' => array(
PDO::ATTR_EMULATE_PREPARES => true,
),
], |
When "connection is sent back to the connection pool" happens? When application closes connection to proxysql? |
ProxySQL Version: proxysql-1.4.3-1-centos67.x86_64.rpm
Laravel use prepared statement default.
This's a emergency that happened in my production:
my backend db status:
In my other db instances that have no proxysql frontend,
Com_stmt_close
is very close toCom_stmt_prepare
.So ProxySQL does not close the stmt? It's ok for now after I restart the proxysql.
By the way, all
PREPARE
andEXECUTE
count number fromstats_mysql_commands_counters
is 0. But there is binary prepared statement executed:Thank you!
The text was updated successfully, but these errors were encountered: