PDA

View Full Version : Running Dtrace for files being opened



4mula1
2008-01-24, 11:43
I started an rsync job last night on my Solaris box and it was still running this morning (and still running now!) so I wanted to see if I could figure out how much it had done. It was scheduled via cron so I have no output on it. I had the idea to use Dtrace to show what files were being opened on the system. Dtrace showed each file being copied but what I was surprised to see was some of the activity from SlimServer, particularly the frequent call to /etc/protocols. It will make 8 seperate requests right in a row, then wait for awhile and do it again.

What's in that file that's so interesting to SlimServer?

jth
2008-01-24, 12:53
Just guessing, but usage of perl's IO::Socket module may trigger reading this file.

4mula1
2008-01-24, 13:11
That may very well be. Since dtrace shows that the process that calls for /etc/protocols is slimserver.pl and not perl I hadn't considered all of the perl modules at play being responsible. I've never run across /etc/protocols before and was a little curious.

It's really amazing how many files get opened every time I log in via ssh...

snarlydwarf
2008-01-24, 13:35
It's really amazing how many files get opened every time I log in via ssh...

Which is why Unix boxes use all unallocated memory for buffers/cache. Some files are accessed a zillion times... and why nscd rocks so much on servers with a ton of users... getpwent() and friends are called a ton of times and an extra cache layer helps.

(Though, alas, nscd coredumps a bunch on my linux boxes... so I just skip it... though I do use db files for passwd and shadow which speeds things up.)

4mula1
2008-01-24, 18:20
I've noticed that nscd, utmpd, init, and automountd are all busy little beavers. SlimServer is a lot busier than I thought but I do use the SuperDateTime plugin (for weather) and the RSS screensaver. I have a feeling those are the reasons that the SlimServer filecache is hit as often as it is.

flipflip
2008-06-13, 08:30
Since dtrace shows that the process that calls for /etc/protocols is slimserver.pl and not perl I hadn't considered all of the perl modules at play being responsible. I've never run across /etc/protocols before and was a little curious.


There's some more information on this one in this thread:

http://forums.slimdevices.com/showthread.php?t=47985&p=311323

We came across this file in connection with harddisk standby (which was prevented by Perl/SC reading this file every 5 minutes or so). This is "fixed" in Perl 5.10.