Writing an obligatory journal post for achievement whoring.
Slashdot videos: Now with more Slashdot!
In the discussion about IBM putatively buying Sun, we were having a side-discussion about prefetches and branch prediction.
I had forgotten why my branch prediction performance experiments had failed ("confirmed the null hypothesis") and had to go back to my notes.
It turns out that mature production software tends to be full of small blocks of error-handling and debug/logging code, which is not often used. A Smarter Colleague[TM] and I set out to test the newly-available branch prediction logic, expecting to see a significant improvement. I manually set the branch prediction bits in a large production application, only to find no detectable improvement.
The test application was Samba, so we changed the driver script to only read a few files from a ram disk, to eliminate disk I/O overheads. Still no detectable advantage from predicting the branches correctly!
Then we tried just a single few functions, under a test framework that did no I/O at all. Still nothing.
Eventually we tracjked it down to the debug/log/else logic: the branches areound it were always taken, but the branch-arounds were long enough that the next instructions were in a different icache line, and the cache-line had to be fetched.
It turned out that we had reproduced in code what our HPC colleagues see in data: the cache doesn't help if you're constantly leaping to a different cache line!
An acquaintance asked about what to measure, and what tools to use, expecting to hear about vmstar, sar or the like.
However, the really interesting measurements are of the application's performance: response time and transactions per second.
Imagine you have a web site which responds in 1/10 second on average, is known to be running on a single cpu (queuing center, to be precise) and is averaging 6 transactions per second (TPS)
From that you know that the maximum performance will be 10 TPS, because ten 1/10ths fit into one second. You also know you're at 60% of the maximum, a nice safe number.
Now correlate this with your average CPU usage, network bandwidth and IO bandwidth, and you have a little estimator for what resources are needed to maintain good performance.
You also know that things will start getting bad at >8 TPS, so if you expect more business in future, you need to add more queuing centers (CPUs) with the appropriate amounts of network and disk I/O bandwidth.
You can also now use both the resource usage figures and tools that all the other folks have suggested, and watch out for growth in each of them. If the trend in their use looks like it will soon get above the number that corresponds to 8 TPS, above, then and only then do you need to start buying resources.
Just a note about an application (Windows only though) I've started using: GreenPrint http://www.printgreener.com/. This marks possibly the first time I've ever sent a software recommendation to my friends and family. If its good enough for them, it might be good enough for some of you!
GreenPrint adds a step between hitting the "Print" button and actually sending the task to the printer. This step allows you to weed out the wasted space before printing and/or saving. It is very easy to use.
How often do people waste paper when printing prototypes, brochures, etc? You can easily prevent 20% of your total printing. Save closer to 50% when printing "1-page" web pages that so often have that one nearly blank page at the end. Save over 50% when printing things with lots of "hidden" text. Ever seen a spreadsheet print 4 blank pages for 1 "real" page (or more)?
There is a free version (GreenPrint World) that is supported by unobtrusive ads, but is not free for commercial use (ie, in the office). C|Net's download.com reports it as verified free of spyware/malware. Home Premium is corporate licensable. Volume licensing is available for the Enterprise version; I don't have a clue what their terms are. Home Premium and Enterprise have additional features. All run on Windows 2000, XP and Vista.
NOTE: I have no interest in the program other than it being a smart way to save trees, time, and money. This isn't spam it is a real review. If you want to see a demo before installing, go here: http://printgreener.com/tutorial.html
- Do you ever:
- need to print only SPECIFIC pages, not everything?
- want to define rules for things like "don't print blank pages!"?
- want to remove images from your document?
- prefer to save a PDF file instead of printing?
- GreenPrint will allow you to:
- remove entire pages (easily, graphically)
- print only text (whole document or selected pages)
- print only images (whole document or selected pages)
NOTE: Don't just use the right-click menu for these, use the "Tools" menu for more control
- Once done you can:
- Print to any of your configured printers
- Save to a PDF (replacing tools like CutePDF)
- Email immediately as a PDF (I didn't get this working but you can email saved PDF files)
- GreenPrint will also:
- Automatically remove blank and "header/footer only" pages
- Automatically remove pages via configurable criteria (ex: less than X lines, etc)
- Alert you before removing pages automatically
- Track the amount of money saved (and define costs on a per-printer basis)
- Track how many pages you have saved
- Handle printer configuration (like you have now)
- Collate pages
PS. As with any 1.00.00 software there are bugs. I reported two today to their support address. I got replies back in under an hour.