How can I log OS X Server disk performance?

Solution 1:

You can use traditional unix tools to start monitoring now.

iostat 60 | tee /tmp/iostat_60.log

The free space statistics can be generated with the df command, but you might just set your warning levels on server app and rely on alerts to notify you when space fills. I can't imagine needing to track storage space more than once a day to graph the growth or manage things, but your needs might be quite different.

I'd say 15 minute (900 seconds for iostat) snaps of io activity would be sufficient and hourly or daily disk space logs would be overkill for most servers. You would probably decrease the monitoring interval during an investigation / performance tuning period, but day in and day out these stats usually just chew up CPU and disk space and don't really help you manage the server.

Once you decide upon how often you want to capture the data, you can get more fancy with a wrapper to start and stop the script / cut and process the log files daily, etc...

I would say you're going to want to instead look at the tools you want for actually analyzing and acting on the data. For one server, you could probably get away with one free instance of splunk running and just log the data to syslog.

From there you can graph / extract to spreadsheet / act on the data in a very flexible manner. Also, you might look at elasticsearch, logstash and kibana.

There is an excellent write up at http://krypted.com/windows-server/stashbox-turning-a-mac-mini-into-a-logstash-server/ by Charles Edge explaining the how and why you would use those tools to tame the logs and graph things. If you had that, sending the statistics to the system log might be a very easy way to solve your problem of monitoring IO on your server.