What can I do to stop high network usage when a network share is mounted in OSX Lion?

Posted on

QUESTION :

I’ve done a lot of googling on this, but I’ve not really found any conclusive answers.

Basically, when I mount a samba share from another machine, Lion goes crazy. I can see from iStat menus that network (wireless) usage varies wildly from 300KB/s, right up to 6/7 MB/s, but my CPU usage doesn’t spike at all. When this is happening the laptop is almost unusable, clicking something can take 30 seconds for a response. I thought that this was something to do with Spotlight trying to index the share, but I’ve since tried it with Spotlight completely disabled, and it still happens. I’ve left the laptop on overnight in the hope that whatever process is causing this would finish, but to no avail. Even when the network usage stops, the laptop is still very unresponsive.

It’s driving me nuts and it means I can’t access my files without having to ftp in instead.

Specs: MacBook Pro, Mac OS X (10.7.3), Late 2011 Core i7 15″, 4GB RAM

edit: tried replicating the problem by mounting the home folder on the target machine, but that didn’t cause the same issues. The home folder only has ~10 files in it.

Is there any way I can monitor what’s heading out across my network card to the server? I suppose I could use Wireshark to log the data, but I’m gonna end up with a lot of extraneous information.

after using the suggestion by Seth Noble below, i see a LOT of this:

23:21:39  read                                           0.000009   GeekTool    
23:21:39  read                                           0.000001   GeekTool    
23:21:39  fcntl                                          0.000002   GeekTool    
23:21:39  fcntl                                          0.000001   GeekTool    
23:21:39  close                                          0.000001   GeekTool    
23:21:39  getdirentries64                                0.005762 W Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1884.JPG    0.000024   Finder      
23:21:39  PAGE_IN_ANON                                   0.000015   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1730.JPG    0.000011   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1668.JPG    0.000009   Finder      
23:21:39  PAGE_IN_ANON                                   0.000010   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1852.JPG    0.000010   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1883.JPG    0.000009   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1737.JPG    0.000009   Finder      
23:21:39  PAGE_IN_ANON                                   0.000014   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1892.JPG    0.000009   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1843.JPG    0.000008   Finder      
23:21:39  getattrlist       m 28-11-2008/IMG_1838.JPG    0.000008   Finder

I have something like 50k+ photos on the share and that would appear to be some of them.

ANSWER :

sudo fs_usage -f filesys

This will produce a running log of all file system activity in the system, including which process/application is responsible for each. Ideally quit everything else before running this to limit the output to just whatever is going on in the background.

Update:
With no applications running, the OS should be pretty quiet, so whatever is causing the I/O activity should dominate the fs_usage output. If its the Finder that is dominating and you have a Window open to the mounted volume, do command j on that folder and see if you have “Calculate all sizes” checked. “Calculate all sizes” will cause the Finder to scan every file in every folder on the mounted volume, which would account for all the activity.

Leave a Reply

Your email address will not be published. Required fields are marked *