2

My machine consumes all CPU for one or two hours processing some systemstats. So far I work around that by regularly cleaning the huge amount of data in /private/var/db/systemstats/

Now I noticed, that I get tons of .stats files created in /var/log/com.apple.launchd.peruser.94. A new file is created about every 20 seconds. A listing looks like this:

bash-3.2# ls -lt
total 136
-rw-------  1 _teamsserver  wheel    268 May 14 09:38 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.rt0Fz3.stats
-rw-r--r--  1 _teamsserver  wheel  16289 May 14 09:38 launchd-shutdown._teamsserver.log
-rw-r--r--  1 _teamsserver  wheel  16487 May 14 09:38 launchd-shutdown._teamsserver.log.1
-rw-------  1 _teamsserver  wheel    268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.gJFx9e.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.dE601a.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.v3CH6Y.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.89LBZP.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:36 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.CO28zM.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:36 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.FDGR7H.stats
-rw-------  1 _teamsserver  wheel    268 May 14 09:35 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.1SJEPv.stats
bash-3.2# 

What is causing this?


I'm running Mavericks 10.9.5 with OSX Server 3.1.2.


EDIT:

Running this ps -u _teamsserver produces this output:

  UID   PID TTY           TIME CMD
   94   258 ??       597:58.63 /usr/bin/python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directory=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on
   94   262 ??         4:45.21 /Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directory=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on
   94   263 ??         1:03.79 /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_receivexlog -h /Library/Server/Wiki/PostgresSocket --no-password --directory /Library/Server/Wiki/Database.xpg/backup --verbose
   94   264 ??         0:25.33 postgres: logger process                                 
   94   266 ??         0:53.21 postgres: checkpointer process                                 
   94   267 ??         1:20.23 postgres: writer process                                 
   94   268 ??         1:15.03 postgres: wal writer process                                 
   94   269 ??         2:55.69 postgres: autovacuum launcher process                                 
   94   270 ??         0:24.03 postgres: archiver process   last was 0000000100000000000000E8                              
   94   271 ??         7:29.90 postgres: stats collector process                                 
   94   279 ??        23:24.36 /Applications/Server.app/Contents/ServerRoot/usr/sbin/collabd
   94   281 ??         0:42.81 postgres: collab collab [local] idle                              
   94   292 ??         0:00.00 postgres: collab collab [local] idle                              
   94   309 ??         2:04.84 postgres: wal sender process _teamsserver [local] streaming 0/E9B06448                              
   94 38417 ??         0:01.39 /Applications/Server.app/Contents/ServerRoot/usr/bin/ruby notifications.rb

Sometimes another line appears which corresponds to the 20 seconds interval:

94 44867 ??         0:00.01 /sbin/launchd

EDIT:

I started launchctl and looked at some commands and output. The list command showed this:

...
263 -   0x7f96d2d27200.anonymous.pg_receivexlog
258 -   0x7f96d2c68620.anonymous.Python
-   0   com.apple.launchd.peruser.94
215 -   0x7f96d2d19890.anonymous.postgres_real
216 -   0x7f96d2d194c0.anonymous.pg_receivexlog
...

Listing the peruser.94 entry several times gives this: (one time with a PID entry, one time not)

launchd% list com.apple.launchd.peruser.94
{
    "Label" = "com.apple.launchd.peruser.94";
    "LimitLoadToSessionType" = "System";
    "OnDemand" = true;
    "LastExitStatus" = 0;
    "TimeOut" = 30;
    "Program" = "/sbin/launchd";
    "EnableTransactions" = true;
    "MachServices" = {
        "com.apple.launchd.peruser.94" = mach-port-object;
    };
};
launchd% list com.apple.launchd.peruser.94
{
    "Label" = "com.apple.launchd.peruser.94";
    "LimitLoadToSessionType" = "System";
    "OnDemand" = true;
    "LastExitStatus" = 0;
    "PID" = 45918;
    "TimeOut" = 30;
    "Program" = "/sbin/launchd";
    "EnableTransactions" = true;
    "MachServices" = {
        "com.apple.launchd.peruser.94" = mach-port-object;
    };
};

I assume that I should be able to follow the route along "MachServices" etc. I will spend some time searching through documentation. Can anybody give me some hints on to where this might lead? How can I find out what this tries to do?


EDIT:

I looked for all entries in /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons containing "_teamsserver":

bash-3.2# pwd
/Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons
bash-3.2# grep -i teams *
com.apple.collabd.expire.plist: <string>_teamsserver</string>
com.apple.collabd.expire.plist: <string>_teamsserver</string>
com.apple.collabd.preview.plist:    <string>_teamsserver</string>
com.apple.collabd.preview.plist:    <string>_teamsserver</string>
com.apple.collabd.quicklook.plist:    <string>_teamsserver</string>
com.apple.collabd.quicklook.plist:    <string>_teamsserver</string>
com.apple.collabd.stats.plist:  <string>_teamsserver</string>
com.apple.collabd.stats.plist:  <string>_teamsserver</string>
com.apple.xcs.stats.plist:  <string>_teamsserver</string>
com.apple.xcs.stats.plist:  <string>_teamsserver</string>
com.apple.xcsbuildd.plist:  <string>_teamsserver</string>
com.apple.xcsbuildd.plist:  <string>_teamsserver</string>
com.apple.xcsdevicesnifferd.plist:  <string>_teamsserver</string>
com.apple.xcsdevicesnifferd.plist:  <string>_teamsserver</string>
bash-3.2# 
  • What's the output of dscl . -list /Users UniqueID | grep 94 ? – Mateusz Szlosek May 14 '15 at 8:20
  • The output is _teamsserver 94 – Rainer Schwarze May 14 '15 at 9:02
  • I have the same issue but for one of our own applications. Anyone know in general what those .stats files are and why they get created? – Johannes 'fish' Ziemke Jul 15 '16 at 11:46
  • I don't know exactly what they are - I'd assume to calculate system use stats. Do you run Mavericks? For me the problems seems to have gone since I upgraded to El Capitan and the corresponding OS X Server. – Rainer Schwarze Jul 16 '16 at 16:53

You must log in to answer this question.

Browse other questions tagged .