TweetFollow Us on Twitter

To Tune, or Not to Tune

Volume Number: 22 (2006)
Issue Number: 8
Column Tag: Tuning

To Tune, or Not to Tune

That is the Question

by Steve Modica

Welcome

One of the things I love about using a Mac is the way Apple supports their customers. Apple provides software and hardware to support the vast majority of their customers' needs. Their updates are reliable and simple, so that customers move to them quickly. As a result, I am typing this article on a system that is similar to 99% of all other Apple systems. If there is a bug lying in wait for me, chances are, someone else has discovered it, and the bug is fixed before I discover it. There is a lot to be said for strength in numbers.

Having spent many years supporting high performance computing customers, I have debugged many calls from customers who were quite sure they were not getting the best performance from their computers. In some cases; they were right! In most cases there were other factors that had nothing to do with system tuning. However, there is always this notion that some "wizard" can come along and wave his magic tuning wand, and for no additional investment, make your system go faster!

Sorting it Out

If you are a car mechanic, certainly, no one would tell you how to fix your car. There are experts who choose to change spark plug brands between summers and winters because they can detect a performance difference. Experts like these, also have the time, equipment, and experience to fix mistakes when they accidentally knock a hose off their engine while poking around. I'd like to refer to this as, "cars as a hobby." This is not about a need for a better-tuned car or a return on investment. It is about having fun working on your car and achieving perfection. These people are honing their art.

Like most PowerBooks, mine is a workhorse. It handles personal and business finances, email, web browsing, and various applications. There are gigabytes of data on there that are extremely important to my family, my business, and me. I don't believe my PowerBook is doing anything different from what Apple intended, nor do I need to tune it. There might be a 5% performance improvement somewhere if I tweak something here or there, but then my PowerBook is no longer like 99% of the other PowerBooks. But now, after making performance optimizations, my increased network performance or maximized disk performance puts me right at the front of the list for finding a hidden bug.

So when should you tune?

First, trying to tune a system that does not have the resources it requires to do the assigned job is like trying to tune a cheaply made guitar. If you are serious about getting work done, get a well-made guitar. Second, if the system's usage pattern is typical, do not tune your system. You are better off taking advantage of all the similarly configured systems doing the same thing that are tuned the same way. But if your system is being asked to do something special, like serving only really large video files, then perhaps tuning is something you may want to consider.

If you call the system your "mail server" or your "file server," then there is a good chance your system is doing a specific task much more often than a typical system. This is when you may find some benefit in tailoring the system configuration settings to that specific task.

Physical bottlenecks

Let's start by considering a fileserver. Assuming your Xserve or "repurposed" PowerMac is not quite making the grade as your fileserver. The first question you have to answer is:

Is this System Capable of Delivering the Performance I Need?

The best way to find this out is to first understand what your traffic looks like, and then break the problem down into easily measurable elements. Files must be read from disk into memory; memory must be turned into mbufs and routed onto the network. Depending on what client systems are doing, clients may need to pull data into memory and then store it to their local disk drives.

Your fileserver must have several resources to operate efficiently. Perhaps the most important resource is memory. Users tend to read the same data over and over again. Operating systems have long since taken this into account with the use of a buffer cache. A buffer cache is an area, set aside in memory, to store information temporarily. This is done so that the CPU can perform other tasks while the IO device fills up the buffer cache. The most recently read data is saved in memory so that it can be accessed quickly, without issuing a redundant read operation to the disk. Similarly, it is often the case that when we read the first byte of a file that we will continue to read many more bytes. Operating systems take this into account and perform read-ahead operations. This enables the operating system to have the data you need in memory even before you have requested it.

Assuming your system is equipped with ample resources; it is easy to isolate the physical limitations of the individual devices. For example, if you have 10 client systems retrieving data from a file server, and each client is achieving 90Mb/sec, then your aggregate network bandwidth is 900Mb/sec. This is the maximum bandwidth of a single Gigabit port. That is a very reasonable limitation. It follows then, that if you want better IO performance for your clients, you simply need to add additional Gigabit ports, and allocate these resources appropriately for each client. You may also see that your CPUs are at 100% utilization, or that your disk bandwidth is at its theoretical maximum throughput.

If you find that the system performs well at certain loads (1-3 clients), but begins to degrade drastically below its physical maximums as you add clients, then consider adding memory so that the operating system has more buffer cache to work with. It is very likely that you simply do not have enough memory, so that each client access requires a direct disk IO operation. If there is not enough memory for buffer cache or not enough memory for the operating system perform read-ahead operations, then disk IO operations become very inefficient.

One way to check how much memory is available for things like the Buffer Cache is to look at the Activity Monitor (Applications -> Utilities -> Activity Monitor). This utility allows the user to examine a number of system resources including CPU, memory and disk bandwidth. Looking at the System Memory pane, one can see how much memory the system is using. "Inactive" memory is memory that has been written out to disk, but is being kept around in case users attempt to access it again. Consider how much data each of your users is accessing and reusing continuously during an edit session. If a typical user is operating on 8GByte files and you have a few hundred MBytes of cached disk data, you probably do not have enough cache. Each time your users move around within their project, they are forcing the system to go back to disk, which creates a large number of inefficient IOs. Simply adding a few Gigabytes of memory will help performance immensely.

Why is it Sometimes Necessary To Tune Your Network?

Wouldn't it be great if somebody wrote a utility that analyzes your network and automatically selects the optimum settings? They already have! It's called TCP/IP, but occasionally it requires some attention. In most cases, TCP works remarkably well all by itself. Tuning is needed in cases where TCP is not optimized because the network behavior is not normal.

TCP/IP is not controlled by any manufacturer and is designed to work on almost any kind of underlying network with widely varying characteristics. To meet this challenge, the protocol designers made TCP adaptive. TCP is self monitoring and optimizes its own behavior to match the network environment. Adaptation takes time and the default settings cannot be optimized for every possible kind of network.

There are also many independent implementations, and the protocols continue to evolve in response to practical experience, and some implementations have peculiar compatibility constraints.

Typical network abnormalities are:

  • Asymmetric connections. These are connections that are much faster downstream, than upstream.
  • High performance connections with relatively long latency (measured in bytes) such as fiber optic, satellite, or point-to-point protocol (PPP) over a cellular network.
  • Point-to-point Protocol over Ethernet (PPPoE) implementations that restrict the maximum transmission unit (MTU) on the network without support for Path MTU Discovery or fragmentation.
  • Heavily congested links. Tuning cannot solve everything. You may need to restructure your network or use packet shaping to control traffic flows.

The key to optimization in such cases is to measure, adjust, and repeat. Notice that it's not necessary to find the perfect settings, only to get close enough that TCP works efficiently in your environment. The tools included with IPNetTunerX from Sustainable Softworks are designed to make this easy and show how well TCP is actually working. (Refer to http://sustworks.com for more information.) Keep it simple. IPNetTunerX offers a collection of presets to solve the most common tuning problems for users with asymmetric broadband connections.

The follow screen shot shows the Basic panel from IPNetTunerX. The Basic panel enables you to select presets that tune certain activities like connecting a Bluetooth phone or just browsing the internet.



Figure 1. IPNetTUnerX Basic Panel

The following screen shot shows the Advanced panel. The Advanced panel enables you to tune individual parameters like the TCP send and receive space.



Figure 2. IPNetTUnerX Advanced Panel

What if I have more than one kind of network connection, like wireless internet served through a satellite? Which one should I tune for?

Just as a chain is only as strong as its weakest link, you want to tune your connection to improve performance over the weakest link or bottleneck. If the connection is highly asymmetrical, has an MTU restriction, high latency, or some other problem, you make adjustments to compensate. The term tuning is misleading in this case because it suggests that you make adjustments to find the optimal setting. A "bottleneck bypass" is a better description. Getting around a bottleneck might reduce performance slightly in another area, but this usually isn't a problem.

Can I tune TCP differently for my Ethernet LAN versus Internet connection if they use different network ports?

TCP sits above the IP network layer so doesn't normally know how the underlying data is routed.

Can I tune TCP at my router, or do I need to tune TCP at each host on my LAN?

TCP is end-to-end, so it generally makes sense to tune TCP at one or both ends of the connection. Some devices offer a packet shaping feature that enables you to adjust TCP traffic flows to reduce congestion. Another possibility is to use a proxy server so that external connections originate from a different host. Depending on the problem, these might be appropriate but are generally more involved.


Steve Modica is CEO of Small Tree Communications, leading designer and manufacturer of high-performance network products for Mac OS X.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.