Very slow performance under Yosemite on Mac mini caused by systemstatsd

The culprit was indeed systemstatsd. The way I understand it, that process both produces a number of system stats, dumps them into a file which it later analyzes. For some reason, that file never got reset, resulting in a giant stats file that took serious resources to analyze.

What I did was stop the analysis daemons, sudo launchctl stop com.apple.systemstatsd sudo launchctl stop com.apple.systemstatsd.analysis

remove the stats dump file (which was about 3 gigs in size at the time) cd /private/var/db/systemstats/ sudo rm snapshots.db

relaunch the daemons sudo launchctl start com.apple.systemstatsd sudo launchctl start com.apple.systemstatsd.analysis

I never figured out why that dump file never got cleared, but suspect it'd something to do with the PRAM, so for good measure I finally reset it by rebooting and pressing CMD, ALT, P, R when the boot chime was heard until it was heard a second time.

The end result is a mac that is very much snappier than before. Here's hoping that zapping the PRAM did eliminate the root cause.

Further reading: What is the use of snapshot.db?


Your systemstats seems to be running out of control, that would explain sluggish operation.

The systemstats process is used to retrieve information about system statistics and power usage

Just to compare I have systemstatsd at 0% CPU usage on my MBA with Mavericks after 50 hours of CPU time. And for the disk usage is 18 MB (from a Total of 45 GB), so no TB's.

You can help it by resetting it.

Copy paste following in your Terminal that is located in your Utility folder.

sudo killall systemstats

enter your log in password when asked.

Or if you do not like using Terminal use the Activity Monitor window:

Select the errant systemstats process and choose the (x) button to force quit.

PS

Yes there are 2 processes, the systemstasts and the systemstatsd.

*

What could be causing it: Generally, there’s nothing to concern yourself with if you see systemstats spike up Activity Monitor or top for a short amount of time, and many standard Mac functions may cause it to temporarily appear. For example, the systemstats process is triggered on the MacBook line by looking at the Energy usage option from the OS X battery menu, and other users may see it briefly when adjusting other Energy settings. The problem arrises when the process is running constantly at very high CPU usage for no apparent reason.

  • You might want to check your Energy usage, your battery ect.. or do a SMC reset.