AFP+Maxing+out

**__AFP__** maxing out was THE issue that brought the group together in the first place. Below are details of our discussions. In the future, we will try to put solutions here and post the dialogue in the discussions portion.  Symptom: **Server Processors maxing out**
 * Fix: Increase the number of AFP Server Threads
 * Steps: serveradmin settings afp:maxThreads=350
 * The default is 40
 * An article said you could go as high as 400
 * To check your current settings, give tag line without the =350 number
 * Must restart server
 * Top command and top –d
 * Used to see processes, a little better than Activity Monitor

**CPU Spikes caused by AFP**

Force Spotlight searching off Turn Spotlight searching off at the share point in Server Admin

At the root of each share point: touch .metadata_never_index

When the CPU maxes, the whole system gets slow (to say the least). I have corresponding AFP rates of ~800MB/s with ~400 users, ~80 concurrent. Apple directed me to the .metadata_never_index in the share point roots. I have, so far, increased threads to 400, turned Spotlight off in Server Admin, redirected cache files, applied the 2009-01 security patch to server and clients, prayed to God, Allah, Zeus, and Apollo, sacrificed small animals (none virginal, though), and called tech support. So far, I'm still searching. ~Kery, EGSD (3.11.09)

 I did remove the odpac.bundle as well, and I don't want to jump the gun: But I think this one did it. ~Kery

 **3.26.2009** East Grand is having AFP spikes again. They went away for about 2 weeks after removing odpac.bundle and inserting .metadat_never_index at the share roots, but we just pegged again. Anyone else as unlucky as we are?

server:/Users/username root# serveradmin settings afp:reconnectTTLInMin=10afp:reconnectTTLInMin = 10 This helped us as well because it forces disconnected users off more quickly. The default is a full day. We were having to force disconnected users off to keep the number of active connections lower by hand before we set this. Now it works a lot better. We had also removed the file odpac.bundle from: System/Library/KerberosPlugins/KerberosAuthDataPlugins/odpac.bundle

I forget the explanation the Apple Rep had for this file, but he stated it wasn't needed and it was one of the things we removed with the other steps you mentioned above. --Justin

These instructions are a bit ambiguous, try this: mm:~ root# **serveradmin settings afp:maxThreads** afp = _empty_dictionary mm:~ root#

Looks like I had no default on that fella- I don't know. Here's another server: mm:~ root# **serveradmin settings afp:maxThreads** afp:maxThreads = 400 (I had previously set that guy to 400, that wasn't default) mm:~ root#

To make a change: mm:~ root# **serveradmin settings afp:maxThreads=300** afp:maxThreads = 300 mm:~ root#

Here's the TTL adjustment, first seeing what I have set: mm:~ root# **serveradmin settings afp:reconnectTTLInMin** afp:reconnectTTLInMin = 20 mm:~ root#

To make a change: mm:~ root# **serveradmin settings afp:reconnectTTLInMin=10** afp:reconnectTTLInMin = 10 mm:~ root#

You have to restart AFP for the new settings to take effect. Are you still having CPU/AFP trouble? ~Kery

 Open Terminal, and su to root: Last login: Thu Mar 29 17:04:36 on ttyp1Welcome to Darwin!server:~ username$ server:~ username$ su rootPassword: Then, although this is something you've probably already done, confirm that the maximum number of threads for AFP is set to a reasonable value: server:/Users/username root#afp:maxThreads = 40 40 is default, and if you have many users, you may wish to set a higher value. It's been established by others through experimentation that 300 to 400 is as high as you should go, assuming your server has plenty of RAM: server:/Users/username root# serveradmin settings afp:maxThreads=300afp:maxThreads = 300 Now, for the kicker. This parameter, "reconnectTTLInMin", is not the same parameter that is set when you adjust the "disconnect idle users after _x_ minutes" value in Server Admin, but is related to that function: server:/Users/username root# serveradmin settings afp:reconnectTTLInMinafp:reconnectTTLInMin = 1440 The default for this parameter is 1440 minutes, which is a full day. But it SEEMS that if it's set to such a high value, something gets "stuck" somewhere else, and these connections are never updated if the machine that fell asleep wakes back up or is shut down or rebooted... there will probably be some side effects from making this change; you may try other values, but the customer who helped me nail this down chose 10 minutes: server:/Users/username root# serveradmin settings afp:reconnectTTLInMin=10afp:reconnectTTLInMin = 10 I THINK that this parameter may define a time after which a sleeping machine is able to reconnect the to the server, but there is a separate session-caching algorithm that affects this, too. Further experimentation with this parameter, and with machines that have been asleep for longer than the value set, is indicated, but I wanted to get the information to my afflicted customers as quickly as possible. The serveradmin Terminal command allows you to view, or change, any parameter in the AFP plist config file, /Library/Preferences/com.apple.AppleFileServer.plist. In later versions of Mac OS X Server 10.4, this file is no longer straight text; if you wish to examine a copy, so you can see what the parameters in this file include, you may either view it with a plist editor such as included with the Developer Tools, or convert A COPY of it to text, as follows:

server:/Users/username root# cp /Library/Preferences/com.apple.AppleFileServer.plist /Library/Preferences/com.apple.AppleFileServer.plist.copy server:/Users/username root# plutil -convert xml1 /Library/Preferences/com.apple.AppleFileServer.plist.copy

Each of the two commands above is a SINGLE LINE which has wrapped in this email. The first one contains just two spaces in the text you must enter, and the second has three, so be careful entering them. This command will convert the "compiled" plist copy to a straight text xml file: server:/Users/username root# plutil -convert xml1 /Library/Preferences/com.apple.AppleFileServer.plist.copy And this one will let you have a look at it: server:/Users/username root# more /Library/Preferences/com.apple.AppleFileServer.plist.copy To summarize, these settings are the most important ones to which you may make adjustments, and the second one is the magic one. The actual numeric values you'd like to apply could fall over a range that has not yet been defined; you are welcome to experiment. serveradmin settings afp:maxThreads=300 serveradmin settings afp:reconnectTTLInMin=10 But REMEMBER these two things: AppleFileServer must be stopped, and restarted, for these values to go into effect. Only convert a COPY of the file to text for viewing, NEVER the original.