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

NetShade 8.3 - Browse privately using an...
NetShade is an anonymous proxy and VPN app+service for Mac. Unblock your Internet through NetShade's high-speed proxy and VPN servers spanning 17 countries. NetShade masks your IP address as you... Read more
Adobe Animate CC 2020 20.0.1 - Animation...
Animate CC 2020 is available as part of Adobe Creative Cloud for as little as $20.99/month (or $9.99/month if you're a previous Flash Professional customer). Animate CC 2020 (was Flash CC) lets you... Read more
Adobe Acrobat DC 19.021.20058 - Powerful...
Acrobat DC is available only as a part of Adobe Creative Cloud, and can only be installed and/or updated through Adobe's Creative Cloud app. Adobe Acrobat DC with Adobe Document Cloud services is... Read more
Adobe Acrobat Reader 19.021.20058 - View...
Adobe Acrobat Reader allows users to view PDF documents. You may not know what a PDF file is, but you've probably come across one at some point. PDF files are used by companies and even the IRS to... Read more
Adobe Flash Player 32.0.0.303 - Plug-in...
Adobe Flash Player is a cross-platform, browser-based application runtime that provides uncompromised viewing of expressive applications, content, and videos across browsers and operating systems.... Read more
Adobe InDesign CC 2019 15.0.1 - Professi...
InDesign CC 2019 is available as part of Adobe Creative Cloud for as little as $20.99/month (or $9.99/month if you're a previous InDesign customer). Adobe InDesign CC 2019 is part of Creative Cloud.... Read more
Adobe Lightroom Classic 9.1 - Import, de...
You can download Lightroom for Mac as a part of Creative Cloud for only $9.99/month with Photoshop, included as part of the photography package. The latest version of Lightroom gives you all of the... Read more
Shredo 1.2.7 - $6.99
Shredo is a beautiful, functional file-shredding and privacy scan utility. It permanently shreds files, folders, and external volumes' contents to keep information secure and impossible for anyone to... Read more
Visual Studio Code 1.41.0 - Cross-platfo...
Visual Studio Code provides developers with a new choice of developer tool that combines the simplicity and streamlined experience of a code editor with the best of what developers need for their... Read more
calibre 4.6.0 - Complete e-book library...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital librarian... Read more

Latest Forum Discussions

See All

King's Throne, the hugely ambitious...
King's Throne: Game of Lust is a deeply immersive medieval-set idle RPG which sees you playing as an ambitious prince, and sole heir to your father's kingdom. On a seemingly ordinary night whilst wandering the king's castle, you make the shocking... | Read more »
Abyssrium Pole is an upcoming aquarium b...
FleroGames' upcoming Abyssrium Pole has recently hit one million pre-registers, which is very impressive, particularly for a fairly casual looking game. Those who have pre-registered will receive 1000 Pearl when the game launches on 8th January... | Read more »
Two Spies is pretty fun, but it's h...
Two Spies just dropped on the App Store this week, and it looks pretty neat. The game has two players capturing various cities across Europe, with the goal of eventually spotting and striking the other spy down. It may be simple-looking, but after... | Read more »
Two Spies is a turn-based game for iOS t...
There aren't too many games that feature pass and play multiplayer and there are even less where you can only play against people you know, even when playing online. But Two Spies does both of those things and you can get it for iOS right now. [... | Read more »
Solve your way through new low-poly puzz...
The best escape-the-room games don’t just test your creative problem-solving skills – they look great, too. Released in October this year by Antler (the developer of the succesful VR puzzle SVRVIVE: The Deus Helix), Krystopia offers everything you... | Read more »
Get ready for an epic adventure with Pea...
Following a hugely successful pre-registration campaign, Pearl Abyss' much-hyped MMORPG, Black Desert Mobile, has finally arrived for iOS and Android. With some of the most impressive visuals on mobile, a vast open world to explore, an in-depth... | Read more »
Elder Scrolls: Blades has ditched chest...
Elder Scrolls: Blades started out as one of the most hyped mobile games of 2019, boasting some impressive visuals and no shortage of promise. Our hopes were somewhat dashed when it eventually launched and we all became privy to its mishandled... | Read more »
Hands-On with the Pocket City December U...
At the end of last month, Codebrew Games announced an update coming to their popular city-builder, Pocket City some time this month. In this update is the promise of expanding your city out into other regions, enacting policies, and more. The full... | Read more »
Black Desert Mobile is available for pre...
Pearl Abyss' stunning open-world MMORPG, Black Desert Mobile, is set to launch for iOS and Android on December 11th at 12 AM PST (8 AM UTC). However, those looking to get in early and test out the in-depth character customisation will be able to... | Read more »
Extraordinary Ones, NetEase's innov...
NetEase's inventive 5v5 anime MOBA, Extraordinary Ones, has now opened for pre-registration ahead of its global launch in early 2020. The game seems to have received a fairly warm reception from fans after its soft-launch earlier in the year,... | Read more »

Price Scanner via MacPrices.net

Apple Watch Series 3 models on sale at Amazon...
Amazon has Apple Watch Series 3 GPS models on sale for $20 off MSRP, starting at only $179. Their prices are the lowest available for these models from any Apple reseller. Choose Amazon as the seller... Read more
Sunday AirPods Sale: Amazon drops prices to a...
Amazon has new 2019 Apple AirPods on sale today ranging up to $30 off MSRP, starting at $139. Shipping is free: – AirPods Pro: $249 $0 off MSRP – AirPods with Wireless Charging Case: $168.95 $30 off... Read more
Holiday 2019 sale: 11″ iPad Pros for up to $2...
Amazon has new Apple 11″ iPad Pros in stock today and on sale for up to $200 off Apple’s MSRP as part of their Holiday 2019 sale. These are the same iPad Pros sold by Apple in its retail and online... Read more
B&H has 12.9″ WiFi iPad Pros on sale for...
B&H Photo has new 12.9″ WiFi iPad Pros on sale for up to $150 off Apple’s MSRP as part of their Holiday 2019 sale. Overnight shipping is free to many addresses in the US: – 12.9″ 64GB WiFi iPad... Read more
Find the best Holiday 2019 prices on Apple’s...
Our Apple award-winning price trackers are the best place to look for the best deals and lowest prices on Apple gear this 2019 Holiday shopping season. Scan our price trackers for the latest... Read more
13″ 2.4GHz/256GB Silver MacBook Pro on sale f...
Amazon has the Silver 13″ 2.4GHz/256GB 4-Core Touch Bar MacBook Pro on sale for $1499.99 shipped. Their price is $300 off Apple’s MSRP, and it’s the lowest price currently available for a 13″ 2.4GHz... Read more
Sams Club one day sales event December 14th:...
Through midnight Saturday night (December 14th), Sams Club online has several Apple Watch Series 5 models on sale for $40 off MSRP as part of their One Day sales event. Choose free shipping or free... Read more
Total Wireless offers iPhone 6S models for as...
Total Wireless has Apple 32GB iPhone 6S models available starting at $99: – 32GB iPhone 6S: $99.99 – 32GB iPhone 6S Plus: $149.99 A no-contract Total Wireless prepaid plan is required with your... Read more
Get a 4 or 6-core Mac Mini for up to $170 off...
B&H Photo has 4-Core and 6-Core Mac minis on sale for up to $170 off Apple’s standard MSRP as part of their Holiday 2019 sale. Overnight shipping is free to many US addresses: – 3.6GHz Quad-Core... Read more
Amazon restocks base 13″ 1.4GHz MacBook Pro f...
Amazon has restocked the base 13″ 1.4GHz/128GB Space Gray MacBook Pro for $1099.99 shipped. Their price is $200 off Apple’s MSRP, and it’s the cheapest price available for a new MacBook Pro. Amazon... Read more

Jobs Board

*Apple* Mobility Sales Professional - Best B...
**750138BR** **Job Title:** Apple Mobility Sales Professional **Job Category:** Store Associates **Store NUmber or Department:** 000471-Mt Vernon-Store **Job Read more
*Apple* Engineering Specialist (ITC ) - Gene...
…Suitability clearance, per contract requirements. Currently, we are seeking an Apple Engineering Specialist in Washington, DC The responsibilities for candidates in Read more
Senior *Apple* Endpoint Engineer - Leidos (...
…Medicaid Service (CMS) End User environment. Perform specific duties as an Apple Endpoint Engineer in support of the infrastructure operations, hardware, software Read more
Perioperative - RN - ( *Apple* Hill Surgical...
Perioperative - RN - ( Apple Hill Surgical Center) Tracking Code 59281 Job Description Monday - Friday - Part Time - Days Possible Saturdays General Summary: Under Read more
Lead DevOps Engineer - *Apple* - Theorem, L...
Job Summary Apple is looking for a seasoned Lead DevOps Engineer that can lead multiple projects and teams while delivering high quality and performant solutions in Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.