6.0.0-beta1
7/8/25

[#12588] Activesync Ping Request Limit
Summary Activesync Ping Request Limit
Queue Synchronization
Queue Version Git master
Type Enhancement
State Rejected
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester horde (at) albasoft (dot) com
Created 08/20/2013 (4340 days ago)
Due
Updated 08/20/2013 (4340 days ago)
Assigned
Resolved 08/20/2013 (4340 days ago)
Milestone
Patch No

History
08/20/2013 04:21:44 PM Michael Rubinsky Comment #4
State ⇒ Rejected
Reply to this comment
Already present in current code.
08/20/2013 03:37:00 PM horde (at) albasoft (dot) com Comment #3 Reply to this comment
Very sorry. That server was running "Horde Groupware Webmail Edition 
5.0.4". I'll update and try again to confirm behaviour.
I can see the changes in current code you pointed in your comment.

Thank you
08/20/2013 03:02:23 PM Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
We already have code that does this. See: 
Horde_ActiveSync_Collections::pollForChanges(). We store the starting 
timestamp of each PING or Heartbeat SYNC request in the syncCache, 
then on each iteration of the PING/SYNC loop we verify that the 
timestamp of the currently running sync is not older than the 
timestamp stored in the syncCache (which would indicate another PING 
process has started). With this code, there should never be more than 
2 running PING requests at anytime, and the older request should 
detect that it's stale and die.

If this is not working for you, I would need to see the synclog 
covering the requests that this is failing for.

FWIW I wanted to use a semaphore to monitor this, but the shared 
memory functions in PHP needed to do this are not present on every 
system. Horde_Cache could be used, but there is no guarantee that one 
is available. At some point, I'll probably end up sniffing out the 
available capabilities then fall back to the syncCache method though 
this will add complexity.
08/20/2013 12:06:33 PM horde (at) albasoft (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Activesync Ping Request Limit
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ New
Reply to this comment
Ping requests are quite heavy resource demanding tasks for a web 
server. In addition, those requests have a very long lasting live, 
compared to any other web server request.

Current Activesync code has no limit to the number of Ping requests a 
server is going to attend for a single user/device. One of my devices 
(Android phone) had some issue that made it fire a Ping request every 
few seconds, so the server ended up trying to fulfill more than 90 
concurrent Ping requests, which degraded whole server performance. It 
shouldn't be a problem if those requests weren't so long lasting.

I think there's no point in attending more than 2 or 3 concurrent Ping 
requests for a single user/device, beyond dealing with mobile devices 
when switching between wireless connections. Right now an error on a 
single device can freeze a nice production server in just a few minutes.

Saved Queries