apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
486 stars 136 forks source link

master process loops on FreeBSD #380

Closed macosforgebot closed 11 years ago

macosforgebot commented 11 years ago

Axel.Rau@… originally submitted this as ticket:800


While testing my new FreeBSD port on FreeBSD 8.2, I see the master process starting stealing cpu cycles after 1st client connect, so:

PID JID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND

39240 11 root 3 76 0 126M 49784K uwait 6 1:38 17.77% python2.7

This continues after the last client has disconnected until shutdown of the server.

Profiling with Run Snake Run shows: The master process spent 98% in _psutil_bsd.get_virtual_mem(). Seems to be an expensive function in FreeBSD. Turning off the call in accesslog resolves the problem.

Patch against git head attached.

macosforgebot commented 11 years ago

Axel.Rau@… originally submitted this as attachment:accesslog.diff:⁠ticket:800


diff --git a/calendarserver/accesslog.py b/calendarserver/accesslog.py

macosforgebot commented 11 years ago

@wsanchez originally submitted this as comment:1:⁠ticket:800


Thanks for the patch.

Committed in r10944

macosforgebot commented 11 years ago

@wsanchez originally submitted this as comment:2:⁠ticket:800