[CalendarServer-dev] memory usage

Andre LaBranche dre at apple.com
Thu Jun 7 23:37:00 PDT 2012


On Jun 7, 2012, at 11:37 AM, Marko Bauhardt wrote:

> Hi Andre.
> 
> 
>> 
>>> The important question is how we can restrict the memory usage for every caldav process?
>> 
>> The server has no built-in facility for doing this. You may be able to use operating system facilities (e.g. ulimit) to accomplish this, or alternatively you could use a small monitoring script to kill worker daemons that get too large (they will automatically be respawned by the master process). There are some known cases where memory use does seem to get out of hand... killing bloated daemons is not a very pretty workaround, but it does work. The downside is that any in-flight requests for the daemon getting killed are aborted. The database is very transactional, so this does not cause any data consistency problems in real-world use (hopefully you noticed the declarative nature of this statement ;)
>> 
> 
> Many thanks for your comments.
> Today in the morning we had the same idea to have a script which kill the worker daemons that get too large :)
> at the moment we do this manually, so this mean we monitor the caldav worker and when some of these process is using too much memory we kill this process. You can imagine: our administrator has no funny nights ;)
> 
> Anyway, thanks for your help, we will write a script or similar which will kill the daemons automatically when necessary.

Out of curiosity, what OS is your server, and how much memory is installed?

In diagnosing this problem (you're not the first to see it), we've been able to determine that the OS X memory allocator behaves differently from Linux's, and the difference is amplified by our specific pattern of memory usage. It's quite an interesting state of affairs, probably worthy of a nice blog post some day...

-dre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-dev/attachments/20120607/95f87b06/attachment.html>


More information about the calendarserver-dev mailing list