Summary | ActiveSync: Too many connections due to MySQL sleep processes |
Queue | Synchronization |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 3. High |
Owners | mrubinsk (at) horde (dot) org |
Requester | chrissi (at) amusing (dot) de |
Created | 03/11/2014 (4122 days ago) |
Due | |
Updated | 03/13/2014 (4120 days ago) |
Assigned | 03/13/2014 (4120 days ago) |
Resolved | 03/13/2014 (4120 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
inserted the "hb" manually yesterday and it ran smoothly the hole night!
Thanks a lot, Michael! Your ActiveSync module rocks :D
State ⇒ Resolved
I'll be mostly unavailable for the next week or so. Please reopen
ticket if the problem persists.
State ⇒ Feedback
commit 1288a7436ba2d95159814f04e3c69264d5fa319e
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Thu Mar 13 00:06:35 2014 -0400
Fix variable name.
Possible fix for
Bug: 13032.../ActiveSync/lib/Horde/ActiveSync/SyncCache.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/1288a7436ba2d95159814f04e3c69264d5fa319e
Assigned to Michael Rubinsky
State ⇒ Assigned
That's a simple typo. I'll fix when I'm back in my office.
I did a litte debugging by myself and stumbled across a diff in the
Horde/ActiveSync/SyncCache.php file:
165c165
< ($cache['lasthbsyncstarted'] >
$this->_data['lasthbsyncstarted'])) {
---
$cache['lasthbsyncstarted'] > $this->_data['lasthbsyncstarted'])) {
($cache['lasthbsyncstarted'] > $this->_data['lasthbsyncstarted'])) {
everything works like a charm, I tested it for 3 hours. As soon as I
use the line from the latest version
(!empty($cache['lastsyncstarted']) && $cache['lasthbsyncstarted'] >
$this->_data['lasthbsyncstarted'])) {
5 minutes after restarting the webserver the connection pool hits the
150 connections limit again.
I hope this information is useful to you!
Regards, Christian
the default max_connections limit of 150, it takes about 5 minutes to
exceed it after the update. We've got about 15 ActiveSync devices,
Android and Apple. I could set a higher max_connections limit, but I
don't think that's necessary, it worked just fine before the update.
Christian
Priority ⇒ 1. Low
State ⇒ Feedback
allowed to remain connected to the server. This causes the client to
have more disconnect/reconnect cycles and uses up more battery power.
Not sure why you are seeing a change though. Nothing in the ActiveSync
code, at least, has changed regarding the number of database
connections required per request.
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ ActiveSync: Too many connections due to MySQL sleep processes
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
today I updated my horde packages through pear. These are the updated
packages:
upgrade ok: channel://pear.horde.org/Horde_Browser-2.0.5
upgrade ok: channel://pear.horde.org/Horde_Url-2.2.2
upgrade ok: channel://pear.horde.org/Horde_Mime-2.3.0
upgrade ok: channel://pear.horde.org/Horde_Group-2.0.3
upgrade ok: channel://pear.horde.org/Horde_Date-2.0.8
upgrade ok: channel://pear.horde.org/Horde_Css_Parser-1.0.4
upgrade ok: channel://pear.horde.org/Horde_Http-2.0.5
upgrade ok: channel://pear.horde.org/Horde_Vfs-2.2.0
upgrade ok: channel://pear.horde.org/Horde_Autoloader-2.1.0
upgrade ok: channel://pear.horde.org/Horde_Auth-2.1.2
upgrade ok: channel://pear.horde.org/Horde_SessionHandler-2.2.4
upgrade ok: channel://pear.php.net/File_Find-1.3.3
upgrade ok: channel://pear.php.net/Text_CAPTCHA-1.0.2
upgrade ok: channel://pecl.php.net/pecl_http-1.7.6
upgrade ok: channel://pear.horde.org/Horde_Db-2.1.0
upgrade ok: channel://pear.horde.org/Horde_Form-2.0.7
upgrade ok: channel://pear.horde.org/Horde_Editor-2.0.4
upgrade ok: channel://pear.horde.org/Horde_ActiveSync-2.13.1
upgrade ok: channel://pear.horde.org/Horde_Alarm-2.1.0
upgrade ok: channel://pear.horde.org/Horde_Timezone-1.0.5
upgrade ok: channel://pear.horde.org/Horde_Crypt-2.4.1
upgrade ok: channel://pear.horde.org/Horde_Imap_Client-2.19.0
upgrade ok: channel://pear.horde.org/Horde_Dav-1.0.4
upgrade ok: channel://pear.horde.org/horde-5.1.6
upgrade ok: channel://pear.horde.org/Horde_Share-2.0.5
upgrade ok: channel://pear.horde.org/imp-6.1.7
upgrade ok: channel://pear.horde.org/nag-4.1.4
upgrade ok: channel://pear.horde.org/ingo-3.1.4
upgrade ok: channel://pear.horde.org/kronolith-4.1.5
upgrade ok: channel://pear.horde.org/turba-4.1.4
upgrade ok: channel://pear.horde.org/gollem-3.0.2
upgrade ok: channel://pear.horde.org/mnemo-4.1.3
upgrade ok: channel://pear.horde.org/webmail-5.1.4
Soon after upgrading I got the error message
"Could not instantiate PDO with DSN
"mysql:protocol=unix;dbname=horde". PDOException: SQLSTATE[HY000]
[1040] Too many connections"
After restarting Apache it worked, but after some minutes the error
reappeared.
So I had a look at the MySQL processes, there were many "Sleep"
processes originating from horde, just like this:
| 165103 | horde | localhost | horde | Sleep | 256
| | NULL |
I had a look into the ActiveSync configuration and set
"$conf[activesync][ping][heartbeatmax]" to 120 (default was 2700),
after that the sleeping connections were terminated after 120 seconds
and the "too many connections" error disappeared. After resetting it
to 2700 the problem reappears.
I'm not sure if it is a problem with ActiveSync, maybe the updated
Horde_Db package is responsible?
Is it a problem to set the heartbeatmax value to 120 seconds? What
could be the cause of the connection problem?
Thanks a lot in advance,
Christian Hailer