Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Disable unneeded Directory Access Services for speed bump System
I came across a number of Directory Access Services that I as an average user do not use. Disabling them, along with disabling network ports not used (in System Preferences -> Network -> Network Port Configurations), has given me a noticable speed improvement. From my experience with Linux, I imagine there are a number of services that many people don't use. Turning off more might yield UI speed improvements like those of Linux counterparts.

To disable extraneous services, launch Directory Access (in /Applications -> Utilities) and click the lock to make changes (enter your password when prompted). For information about what each service does, select Directory Access Help from the Help menu. When Help opens, click "Tell Me More" and then select "What are Directory Services" and "Configuring Open Service Directory Protocols." As an example, here's a bit of the output from the second selection:
Open Directory uses many protocols to access administrative data in directory domains and discover services on the network. You can enable or disable each of the protocols individually by using the Directory Access application. The protocols include:
  • AppleTalk, the legacy Mac OS protocol for file and print services. AppleTalk is configured automatically.
  • BSD Configuration Files, the original method still used by some organizations for accessing administrative data on UNIX computers.
[trimmed...]

If you disable a protocol on a computer, Open Directory does not use it for directory access or service discovery on the computer. Other network services may still use the protocol, however. For example, if you disable the AppleTalk protocol, OpenDirectory does not use it to discover file servers, but you can still connect to an AppleTalk file server if you know its URL.
After reading this, I turned off all of them as I am at home and not on a network. I have noticed improved use of memory and no problems. Note: I did notice some information I'm not sure about in /var -> log -> system that is too long to mention here.

It would be nice if there was a way to shut off some unused startup items and extensions such as Apache, Samba, Internet Firewall and others that aren't used. MOX Optimize or Alfred will let you do this but I broke my system once disabling extensions.

[robg adds: I haven't done any empirical testing to back up the assertion that disabling these services will provide a speed bump ... but if you don't need the services, you may wish to disable some of them to see if it makes a difference on your machine.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[15,936 views]  

Disable unneeded Directory Access Services for speed bump | 9 comments | Create New Account
Click here to return to the 'Disable unneeded Directory Access Services for speed bump' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Disable unneeded Directory Access Services for speed bump
Authored by: foobar104 on Jun 11, '03 11:01:31AM
It would be nice if there was a way to shut off some unused startup items and extensions such as Apache, Samba, Internet Firewall and others that aren't used.

To turn off Samba, go to the Sharing prefs pane, the "Services" tab, and uncheck the "Windows File Sharing" service. To turn off Apache, uncheck the "Personal Web Sharing" serivce. (Actually, I'm almost certain that these services are off by default, so there's no reason to turn them off unless you or another administrator has turned them on at some point in the past.)

It's important to note, though, that these services don't really use any memory to speak of or any CPU time unless they're actually used. If you're on a home machine with no network connection, you can run Apache all you like and never notice, because it won't do anything unless it receives a request. Same with Samba. The internet firewall isn't actually a service; it's a part of the operating system kernel. It doesn't "run" in any meaningful sense. It just defines rules for the kernel about what connections the system will and will not accept.

[ Reply to This | # ]

tinkering
Authored by: hayne on Jun 11, '03 12:52:10PM

I agree with what foobar104 said.
But I believe the original poster was talking about removing kernel extensions (kext's). I do not believe there is any good reason to do this sort of thing as far as system performance goes. Some people just like to tinker. But I don't think it should be generally recommended.

I would be very interested to see some quantitative evidence that removing unused services, etc results in a performance increase.



[ Reply to This | # ]
tinkering
Authored by: sharumpe on Jun 11, '03 01:40:13PM

I don't think there are kernel extensions for things like Apache or Samba. They're services, not a part of the kernel. Now, I don't know what kind of voodoo they've done to get samba to mount as an icon on your desktop, but I doubt it's directly to Samba -- does Samba's license require Apple to contribute changes back to the source?

Mr. Sharumpe



[ Reply to This | # ]
smbfs.kext
Authored by: hayne on Jun 11, '03 02:04:04PM

There is a kernel extension "smbfs.kext" which is used for Samba.



[ Reply to This | # ]
smbfs.kext
Authored by: ScooterComputer on Jun 11, '03 04:59:54PM
No, it is not used for Samba, although it is part of Samba. It is used to mount SMB filesystems; so don't disable it if you have need to access Windows fileshares. Even if you don't need it, it shouldn't use any memory, as it is loaded dynamically by the autodiskmounter.

[ Reply to This | # ]
Disable unneeded Directory Access Services for speed bump
Authored by: jeffmr on Jun 12, '03 03:17:33AM

Hello,
I am the original poster of this hint.

foobar - Yes, those services are 'off' by default. However, they are loaded at startup either as background services or kernel extensions available to be started. Because of this, because the kernel remains loaded into memory at all times and because cpu cycles are consumed from querying hardware or other purposes of these having them disabled can improve the speed and efficiency of your computer.

One of the tasks the Unix users learn to do when setting up their operating system is to build a kernel tailored to their hardware for speed, efficiency and fewer compatibility issues. This means removing unused extensions from the kernel for hardware and services you don't have. This can turn out to be quite a few considering the wide array of hardware available. For these reasons, all of these services could be disabled and improve the amount of memory and cpu cycles available to other applications.

The Directory Services Help says that all of these services are network services that you won't use unless you are connected to a network that uses them. I connect to the internet through a modem at home, so I won't use them. However, I wonder if these Directory Services affect local Directory Accesses on my computer. Unix is a network based operating system. Even its own filesystem is considered by itself a network. 127.0.0.1 is the network address of your computer to itself, also known as loopback.

From my testing, with the inclusion of disabling unused network port configurations, my startup time is about half of that with ports and services turned on.

Idle memory usage after fresh boot is a difference of 2% between the two monitoring with iPulse.

/var/log/system.log does not seem to report any strangeness between boots for each configuration

Memory paging seems to be slightly more without the services activated, although I have not tested this extensively.

Besides iPulse, stopwatch monitoring and checking logs, XBench is another way of testing. I'm not sure if its test results are accurate in this situation though because they test hardware and not the operating system itself. I did not notice a difference in my testing with it.

There are many startup programs and services that can be disabled. For a decent list look at MOX Optimize or Alfred. Apache, Appleshare, SMB and others are listed. Even though Appleshare is turned off in Diretory Access, it is still running in the background as are the others. Likewise, there are many kernel extensions unused by the operating system for each person's hardware configuration. An example is four or so adaptec pci extensions. PowerBook users will never use those. The IP Firewall extension is unnecessary if you don't use your firewall, but it loads every time at startup.

I would be interested to hear input from others as well as test results. Thank you.

Jeff



[ Reply to This | # ]
Disable unneeded Directory Access Services for speed bump
Authored by: g_nix on Jun 12, '03 05:27:31AM

The startup items don't do anything if the service is disabled - they are simple shell scripts which check to see if the service is enabled, and if so, start it. Once the StartupItem script for a service has run, memory is only consumed if the service was enabled, and has started. StartupItems have no connection to the kernel. They are the OS X equivilant of Linux init scripts.

To check if the service in question is really running (and thus consuming memory) run top, process viewer or ps, and look for smbd and nmbd (samba) httpd (apache) or AppleFileServer (AFP filesharing)

By removing kexts, I assume that you want to remove the likes of smbfs.kext. This is not part of samba, but as previously stated a filesystem driver for the kernel. Removing these won't necessarily improve speed, because these aren't programs as such, but rather just collections of routines which the kernel calls upon when it requires them. Removing them will reduce the memory footprint of the kernel, but only by a matter of a couple of hundred K per kext, which won't have a significant effect on performance.

You can inspect the memory usage of each loaded kext by running (sudo or as root) kextstat (kmodstat on 10.1). This will show the name, address, size and memory usage of each module. By doing this, you should also be able to see that the smbfs kext is only loaded after you have attempted to mount an smb share.

There will always be more loaded kexts than on a Linux system, because the darwin kernel is designed to be completely modular, whereas modules in Linux were conceived to make a monolithic kernel more compact.

The Darwin kernel isn't monolithic, and AFAIK cannot be compiled as a monolithic kernel. Any kexts required to make the kernel work at boot time (disk and display drivers, etc.) are wrapped up into a file called Extensions.mkext, which is loaded into memory at the same time as the kernel, so that the kernel can access these devices.

Tampering with apple supplied kexts is a dangerous activity because it may cause upgrades to fail, or produce an inconsistant kernel.

For more info about how the kernel and darwin layers work, check out http://www.opendarwin.org/en/faq.php

Gavin



[ Reply to This | # ]
Disable unneeded Directory Access Services for speed bump
Authored by: Darkshadow on Jun 12, '03 09:29:37AM

Right - StartupItems are just shell scripts that will start a service if the file /etc/hostconfig says they should be started. If you really want a StartupItem disabled, and don't see an obvious way to do it, editing that file will allow you to.

Since you seem to know about compiling the Linux kernel, then you'll probably know about kernel modules. kexts are the same thing. Apple just calls them 'extensions' rather than 'modules' is all. But they do exactly the same thing - they don't load the drivers into memory unless said drivers are necessary. And like modules in Linux, you can manually load and unload kexts if you want to - commands are kextload and kextunload.

If you really wanted to, you could download Darwin and compile it yourself. I'm sure there probably are a few things compiled in that not everybody needs, so you may get some optimization by doing so, but I doubt it would make a big difference.

BTW, the only speed increase you get by disabling stuff in Directory Access is related to search time. It's not ever going to be a big increase. You can also increase speed a bit by editing your NetInfo domain and lowering the timeout values.



[ Reply to This | # ]
Disable unneeded Directory Access Services for speed bump
Authored by: tbmaddux on Jun 13, '03 09:20:39AM
According to John Timmer at OSXFAQ.com, all kexts marked as needed for booting are loaded from Extensions.mkext at boot time by BootX and then unused ones are unloaded from memory by kextd:

I Thought Mac OS X Was Supposed To Be The End Of Extensions Hell ??

So removing kexts is only going to be of benefit at bootup, which isn't often on my MacOS X systems.

[ Reply to This | # ]