max_user_connections issue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| MySQL Server |
Unknown
|
Unknown
|
||
| Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Unassigned | |
| 5.1 |
Won't Fix
|
Medium
|
Unassigned | |
| 5.5 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hello
We are using max_user_
Three weeks ago we upgraded 6 servers to Percona-Server-5.5 from 5.1.
And right after upgrade we noticed a problem with max_user_
Users that connects to database very often, started to experience problem:
User ***** already has more than 'max_user_
But "SHOW PROCESSLIST" did not list any active connections for this user!
How you know, 5.5 has max_user_
We put max_user_
Known symptoms:
- Problem does not come up after mysql restart. It takes some time.
- "flush privileges" helps to reset counter, but after few hours issue is active again.
It fills like max_user_
Server hardware:
32GB RAM. 4x4 core CPUs, SAS HDDS in RAID1 for /var/lib/mysql.
OS: centos5 x86_64
I am ready to provide any information that will help to find and resolve this issue.
Thank you.
Regards,
Gor
Gor Martsen (gor-x) wrote : | #1 |
Patrick Crews (patrick-crews) wrote : | #2 |
Changed in percona-server: | |
importance: | Undecided → Medium |
assignee: | nobody → Patrick Crews (patrick-crews) |
Hi Patrick
We are working on it too.
I will send you more details when be back home.
Regards,
Gor
Sent from my iPhone
On 2011-12-28, at 9:55 PM, Patrick Crews <email address hidden> wrote:
> Hi. I'll be taking a look at this bug soon and will be in touch if I
> have issues duplicating the problem.
>
> Thanks for the bug report,
> Patrick
>
> ** Changed in: percona-server
> Importance: Undecided => Medium
>
> ** Changed in: percona-server
> Assignee: (unassigned) => Patrick Crews (patrick-crews)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> max_user_
>
> Status in Percona Server with XtraDB:
> New
>
> Bug description:
> Hello
>
> We are using max_user_
> Three weeks ago we upgraded 6 servers to Percona-Server-5.5 from 5.1.
>
> And right after upgrade we noticed a problem with max_user_
> on all upgraded servers.
>
> Users that connects to database very often, started to experience problem:
> User ***** already has more than 'max_user_
> But "SHOW PROCESSLIST" did not list any active connections for this user!
>
> How you know, 5.5 has max_user_
> We put max_user_
>
> Known symptoms:
> - Problem does not come up after mysql restart. It takes some time.
> - "flush privileges" helps to reset counter, but after few hours issue is active again.
>
> It fills like max_user_
> users doesn't reset for some bug reason.
>
> Server hardware:
> 32GB RAM. 4x4 core CPUs, SAS HDDS in RAID1 for /var/lib/mysql.
> OS: centos5 x86_64
>
> I am ready to provide any information that will help to find and
> resolve this issue.
>
> Thank you.
>
> Regards,
> Gor
>
> To manage notifications about this bug go to:
> https:/
Gor Martsen (gor-x) wrote : | #4 |
Hello Patrick.
Few more details about this bug.
On our servers we have [Warning] Too many connections.
Probably server does not decrease user connections when it happens.
But it is just a guess.
Let me know if you cannot repeat this bug, I will try to build it up for you.
Gor Martsen (gor-x) wrote : | #5 |
Hello Patrick.
Right now I found a way to reproduce this bug.
You need two users with 3 grands.
test1 to database test1
test2 to databases test2 and mysqlslap
my.cnf settings:
[mysqld]
max_connections=50
max_user_
log-warnings=10
Changes to mysql.user table:
set max_user_
Now you have to start 3 processes:
# it is help to have Too many connections error (max_connections field)
mysqlslap --concurrency=10 --iterations=1000 --auto-generate-sql --engine=innodb --number-
# it is help to have 1226 User 'test2' has exceeded the 'max_user_
mysqlslap --concurrency=5 --iterations=1000 --auto-generate-sql --engine=innodb --number-
# this one overloading all limits (max_connections and max_user_
mysqlslap --concurrency=100 --iterations=100 --number-int-cols=2 --number-
It takes time, while bug will show itself.
You can speed it up by:
mysql> set global max_connections =20;
And right away you will see:
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1040 Too many connections
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
mysqlslap: Error when connecting to server: 1226 User 'test2' has exceeded the 'max_user_
Thats it.
Now you can interrupt all mysqlslaps and start new one: (don't restart mysql)
[root@nestor ~]# mysqlslap --concurrency=10 --iterations=1000 --auto-generate-sql --engi...
Changed in percona-server: | |
status: | New → Triaged |
assignee: | Patrick Crews (patrick-crews) → nobody |
Changed in percona-server: | |
status: | Triaged → Confirmed |
Gor Martsen (gor-x) wrote : | #6 |
We resolved this issue.
In function acl_authenticate after check_for_
We need to decrease uc->connections before return.
Patch tested, it works how it expected.
Please confirm.
description: | updated |
Alexey Kopytov (akopytov) wrote : | #7 |
The problem analysis and the patch look correct to me. Let's fix it in 5.1.61 and 5.5.21? Whoever merges the patch should also report the bug upstream.
Olivier Doucet (odoucet) wrote : | #8 |
I think I'm experiencing the same symptoms on a very large SQL server.
I was hitting a max_user_
Server version is Percona 5.5.17-22.1
My problem is documented in internal Percona support as issue #23110
Gor Martsen (gor-x) wrote : | #9 |
Try to use our patch. It should help.
We use it since January, no problem anymore.
I don't know why this simple patch is not applied yet.
Olivier Doucet (odoucet) wrote : | #10 |
Have you opened a bug in MySQL bugtracker ? I'm sure this big is not limited to Percona version.
Olivier Doucet (odoucet) wrote : | #11 |
I opened bug #65104 at http://
Gor Martsen (gor-x) wrote : | #12 |
You are right, it affects MySQL too.
I've tried but received strange message that they will contact me.
Probably I did something wrong.
Thank you. Will track it too.
Best Regards,
Gor
Olivier Doucet (odoucet) wrote : | #13 |
Oracle contacted me on April 30th and said they were waiting for an Oracle Contributor Agreement signed from you Gor, to get your fix included directly in MySQL.
Gor Martsen (gor-x) wrote : | #14 |
HI all,
I sent signed OCA.
I hope they will accept this patch soon.
tags: | added: i23110 |
Gor Martsen (gor-x) wrote : | #15 |
Is there any plans to fix this issue ?
Ivan Zahariev (famzah) wrote : | #16 |
If Oracle are not cooperating, please at least fix this in the Percona release. It's been 7 months now since this is a known bug.
tags: | added: contribution |
The upstream bug seems to have been fixed already in 5.5.27 release.
From http://
" If an account had a nonzero MAX_USER_
So, it will be in upcoming PS 5.5.27 release as well.
http://
@Gor, they seem to have slightly changed your patch.
Gor Martsen (gor-x) wrote : | #19 |
Finally!
Thank you for link. Looks like the added more code there.
Alexey Kopytov (akopytov) wrote : | #20 |
Fixed upstream in the (later recalled) 5.5.26 release. Setting to Fix Released for Percona Server 5.5.27-28.0.
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
Hi. I'll be taking a look at this bug soon and will be in touch if I have issues duplicating the problem.
Thanks for the bug report,
Patrick