[horde] Horde activesync causes high cpu load

Michael J Rubinsky mrubinsk at horde.org
Wed Apr 11 14:05:58 UTC 2012


Quoting Hans de Groot <hansg at dandy.nl>:

> Hello ,
>
> I tried active sync and actually got it to work with my android 2.3.5.
> I added a new account to the stock mail client and  choose exchange as
> protocol. This way I did not only add mail but also my horde agenda and
> contacts.
> The agenda and I think also the contacts worked, the email dit not work
> but I rather use imap for mail anyway.

Email sync is not supported in Horde 4. This feature (along with more  
recent protocol version support) will be available in the upcoming  
Horde 5 release. See http://wiki.horde.org/ActiveSync for more details.


> But there was a problem.
>
> I found that my webmail  server had a high load and at least 5
> connections open to my phone. I waited to bit to see if they went away
> bit they did not. Mean while normal webmail became un usable slow. (like
> 2 minutes to load a page)
>
> When killing the apache processes they came back again in a few seconds.
>
> How many connections is active sync supposd to make?

This is highly dependent on the client itself. Android's ActiveSync  
client is notoriously flakey - especially in the earlier Android  
versions. What's *supposed* to happen is a single PING request that  
monitors for changes in all of your selected collections. Some clients  
will issue a single PING request for each collection. A sync log  
should shed light on this.

> Why does the connection keep using so much cpu? (ie 5% +)

Without a sync log, this is impossible to guess at. Though I will say  
the ActiveSync, in gereral will definitely increase your server load  
to some extent due to the nature of the protocol. This will improve  
somewhat once EAS 12.1 support is added to Horde 5.

> If active sync uses a push construction does that mean that it always
> has to keep open a connection to apache?

Yes. A connection is kept open during the PING "heartbeat". During  
this time, the server continually checks for changes in the  
collections you have requested to be sync'd. The amount of time  
between checks (as well as various heartbeat timing settings) are  
configurable in Horde - though it's usually best to let the device  
manage this.

> Can I tell horde not to allow the use of push but to only let the client
> connect periodically?  (I really only want to sync calendar and contacts,
> not my mail, mail can be read by imap)

No, this is not done on the server, but rather on the client since it  
depends on the commands received from the client. Some (most?) clients  
will have a setting for the frequency to check email with "push" as  
the default. If you select one of the other choices, the client  
*should* only send a SYNC request once per configured time period  
instead of a PING request (which is the request that maintains the  
server connection).

Also, as stated above, mail will not be sync'd anyway. More recent  
versions of Horde_ActiveSync "pretend" to sync email since some  
clients will never issue the necessary SYNC requests to sync other  
collections if email sync is not enabled (Android 4 does this).  
Starting in Horde 5, full email support is included and yes, you can  
turn it off if you prefer to connect directly over IMAP.

> I am really worried to enable active sync if that means that only about
> 15 users take down my server. (15*5=75 concurrent connections ) that
> leaves nothing for the webmail!
>
> Ps here are some line of my access log, maybe there was soemthing wrong
> that caused the high load
>
> POST
> /Microsoft-Server-ActiveSync?Cmd=Sync&User=jan%40test.nl&DeviceId=androidc10021111111&DeviceType=Android HTTP/1.1"  
> 200
> 76 "-" "Android/0.3"
> POST
> /Microsoft-Server-ActiveSync?Cmd=Ping&User=jan%40test.nl&DeviceId=androidc10011111111&DeviceType=Android HTTP/1.1"  
> 200
> 36 "-" "Android/0.3"
> POST
> /Microsoft-Server-ActiveSync?Cmd=FolderSync&User=jan%40test.nl&DeviceId=androidc1001111111&DeviceType=Android  
> HTTP/1.1"
> 200 63

This only shows that your device made normal ActiveSync requests to  
(1) Perform some SYNC operation, (2) Perform a PING (waiting for  
changes) and then (3) Perform a full folder sync. It's impossible to  
tell just from this if there is any issule. I would need a full sync  
log. See the ActiveSync wiki page.

-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6096 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/horde/attachments/20120411/72f9b6f7/attachment.bin>


More information about the horde mailing list