More Efficient Software = Less Energy Consumption: Green Computing isn’t just Hardware and Virtualization

Originally published 16 November 2009.

Green is a great buzzword, but the real-world driver for many “green” efforts is cost. Data center power is expensive. Years ago, Oracle moved a major data center from California to my town Austin, Texas. A key reason: more predictably priced, cheaper power in Texas vs. California. What if Oracle could make the data center half the size and take half the power because its software ran more efficiently?

Your bank, your brokerage, Google, Yahoo, Facebook, Amazon, countless e-commerce sites and more often require surprisingly many servers.  Servers have traditionally been power-hungry things favoring reliability and redundancy over cost and power utilization.  As we do more on the web, servers do more behind the scenes.  The amount of computing power or various subsystem capabilities required varies drastically based on how an application works.

These days, hardware vendors across the IT gamut try to claim their data center and server solutions are more power efficient. The big push for consolidation and server virtualization (the practice by which one physical server functions as several virtual servers which share the hardware of the physical machine) does make some real sense.  In addition to using less power, such approaches often simplify deployment, integration, management and administration. It’s usually easier to manage fewer boxes than more, and the interchangeability facilitated by things like virtualization combined with good planning make solutions more flexible and able to more effectively scale on demand.

Ironically, the issue people seem to pay the least attention to is perhaps the most crucial: the efficiency of software.  Software orchestrates everything computers do.  The more computer processors, memory, hard drives and networks do, the more power they need and the bigger or more plentiful they must be. One needs more servers or more power burning servers the more operations those servers must perform.  The software is in charge.  When it comes to operations the computer performs, the software is both the CEO and the mid-level tactical managers that can make all the difference in the world.  If software can be architected, coded or compiled to be manage more efficiently the operations per unit of work produced goes down.  Every operation saved means power saved.

Computers typically perform a lot of overly redundant or otherwise unneeded operations. For example, a lot of data is passed across the network not because it absolutely needs to be, but because it’s easier for a developer to build an app that operates that way or the application to be implemented that way in production. There are applications that use central databases for caches when a local in-memory cache would not only be orders of magnitude faster but also burn less power. Each time data goes across a network it must be processed on each end and often formatted and reformatted multiple times.

A typical web service call (REST, SOAP, etc) – the so-called holy grail of interoperability, modularity and inter-system communication in some communities – is a wonderful enabler, but it does involve parsing (e.g. turning text data into things the computer understands), marshalling (a process by which data is transformed typically to facilitate transport or storage) and often many layers of function calls, security checks and other things.  The use of web services is not inherently evil, but far more carbon gets burned to make a web service call to a server across the country or even inches away than it is for the computer to talk to its own memory.  It’s also a lot slower.

Don’t get me wrong, I’m a big believer in the “army of ants” approach. However, I see the next big things in power utilization being software driven. We’re going to reach a point where we’ve consolidated all we reasonably can, and at that point it’s going to be a focus on making the software more efficient.

If my code runs in a Hadoop-like (Hadoop is open source software that facilitates computing across many computers) cluster and the framework has tremendous overhead compared to what I’m processing, how much smaller could I make the cluster if I could remove that overhead? What if I process more things at once in the same place? What if I batch them more? What if I can reduce remote calls? What if I explore new languages like Go with multi-core paradigms?  What about widely deployed operating systems like Linux, Windows and MacOS become more power efficient.  What about widely used apps consuming less power hungry memory?  What about security software taking fewer overhead CPU cycles?  Can we use multi-core processing more efficiently?

In most cases, performance boosts and power savings go hand-in-hand.  Oriented toward developers, here are a few more obvious areas for improvement.  Most are pre-existing good software design practices:

– Caching is the first obvious place:  (1) more caching of information, (2) less reprocessing of information, (3) more granular caching to facilitate caching where it was not previously done.

– Data locality:  Do processing as close to where data resides as possible to reduce transportation costs.  Distance is often best measured not in physical distance but in the number of subsystems (both hardware and software) that data must flow through.

– Limit redundant requests:  Once you have something retrieved or cached locally, use it intelligently:  (1) collect changes locally and commit them to a central remote location such as a database only as often as you need to, (2) use algorithms that can account for changes without synchronizing as often with data on other servers.

– Maximize use of what you have:  A system is burning power if it’s just on.  Use the system fully without being wasteful:  (1) careful use of non-blocking (things that move on instead of having the computer wait for a response from a component) operations in ways that let the computer do other things while it’s waiting;  (2) optimize the running and synchronization of multiple processes to balance use, process duration and inter-process communication such that the most work gets done with least waiting or overhead.

– Choose the language, platform and level of optimization based on amount of overall resources consumed:  Use higher performance languages or components and more optimizations for sections which account for the most resource utilization (execution time, memory use, etc.).  Conversely, use easier to build or cheaper components that account for less overall resource use so that more focus can go to critical sections.  (I do this in practice by mixing Ruby, Java and other languages inside the JRuby platform.)

In certain applications, maybe we don’t care about power utilization or much at all about efficiency, but as applications become increasingly large and execute across more servers development costs in some scenarios may become secondary to computing resources.  Some goals are simply not attainable unless an application makes efficient use of resources, and that focus on efficiency may pay unexpected dividends.

Developers especially of large-scale or widely deployed applications, if we want to be greener let’s focus on run-times, compilers and the new and the yet-to-be-developed paradigms for distributed massively multi-core computing.

There is a story that Steve Jobs once motivated Apple engineers to make a computer boot faster by explaining how many lifetimes of waiting such a boost might save.  Could the global impact of software design be more than we imagine?

[ Edit 14 October 2018: See also: Math Pierces Steve Jobs’ Reality Distortion Field after 35 Years. ]

Why Ruby on Rails + JRuby over PHP: My Take, Shorter Version

As a Ruby, Java and occasional C/C++ developer who has also written some production code in PHP, I work with and tend to prefer the power and flexibility provided by a JRuby + NetBeans + Glassfish stack over PHP.  Here is my attempt to somewhat briefly describe not only why but also to encourage others to develop in RoR vs. PHP:


–          Exceptionally high developer productivity with:

  • “Programming through configuration” philosophy
  • Emphasis on rather complete default behaviors
  • Write-once (DRY) orientation
  • Simple ORM (ActiveRecord) means a lot less SQL with minimal fuss
  • Dynamically typed language means a lot less thinking about variable declarations
  • Result:  A lot less grunt work; more focus on “real work”

–          Strongly encourages clean MVC architecture

–          Test frameworks

  • TestUnit is easy to use and effective
  • Enables test driven development (TDD) often omitted in PHP world
  • UI mocking frameworks are available

–          Pre-packaged database migrations feature eases schema creation and changes

  • Helper methods further simplify and aid to avoid writing SQL
  • Roll back or forward to arbitrary versions

–          Significant pre-packaged forms and JavaScript/AJAX UI support

–          Ruby language easy to learn and more versatile

  • Like PHP, Ruby language’s initial learning curve is much easier than Java, C#, etc.
  • Like PHP, Ruby language conducive to scripting as well as slightly better OOP support
  • Ruby language skills can be leveraged for use in environments outside web applications

–          Vendor support by Sun Micro

  • Dedicated team and significant JRuby project
  • Good support in NetBeans IDE
  • Quality Glassfish app server from JEE world
  • Provides integrated NetBeans, Glassfish, JRuby stack in one download

–          Tap JEE power from within Ruby

  • JRuby allows fairly seamless access to Java and JEE libraries and features as well as your own Java code should you desire
  • Result:  You can start simple without being boxed in, and you can later add a lot of enterprise-grade sophistication.

–          Community

  • Contains a lot of talent from JEE world
  • Libraries that implement simpler versions of enterprise-oriented features
  • Community tends to be rather friendly and inclusive


–          Maturity

  • Despite making huge strides, acceptance remains low at more conservative companies
  • Hosting options limited in comparison to PHP
    • Dedicated server or VPS
    • Amazon EC2
    • Smaller pool of shared hosts
  • The ORM can be a memory hog
  • Fewer jobs open due to fewer projects (job to applicant ratio might be greater though?)
  • Fewer sysadmins and established maintenance procedures
  • Less support, fewer developers to maintain RoR apps

–          LAMP-like scalability limitations for conventional architecture are comparable or more resource intensive than most PHP solutions

–          Of course, if venturing heavily into cross-platform JEE territory the learning curve steepens dramatically

Associated Press going too far?

Recently the widely used wire service has started charging for excerpts using more than 4 words. Under fair use rules and established copyright law authors of editorials and reviews are ordinarily permitted to excerpt from a work without permission from the copyright holder as long as the source is properly identified.

In a NY Times article dated July 23, 2009:

“In an interview, [AP’s chief executive Tom Curley] specifically cited references that include a headline and a link to an article, a standard practice of search engines like Google, Bing and Yahoo, news aggregators and blogs.” —Richard Perez-Pena, NY Times

AP has been on a road to protect its content and revenue stream for a while taking what some see as overreaching measures. Last year, the Drudge Report’s liberal opposite Drudge Retort was at the center of a publicized dispute (about the case) over content posted by its contributors. AP’s legal eagles have been reportedly going after a number of sites and bloggers, and a form of automated DRM (AP’s press release on the subject) is also being rolled out.

In the last couple of days, many are pointing to James Grimmelmann’s experiment where he was charged to license words clearly in the public domain (Grimmelmann’s blog post). Mr. Grimmelmann was refunded his money and the license rescinded having no implications on his use of them given that the words – a quote by Thomas Jefferson – are already in public domain. AP likened the experiment to running an item you’ve already paid for through a self-serve grocery store checkout station.

The iCopyright system which Grimmelmann used to license the content runs on the honor system, and according to others licensees can copy paste text into it that they intend to use. The system is relatively simple and apparently at least in this case did not check the public domain status of the content. Given that we are dealing with a system that already provides the user some discretion about what’s entered, is the Grimmelmann story a minor procedural flaw and not really a big deal?

As AP points out, reporters should be paid for their work. Why should bloggers – especially those few who turn a profit – be freeloading on a hardworking industry that requires real people and real infrastructure on the ground asking questions and going places. Furthermore, in today’s era of sound bytes, sometimes just a few words tell the story.

Traditional media’s revenue sources and business models are on shaky ground with print – a big part of AP’s customer base – in the most precarious position. When content can be syndicated, rehashed or even originated by so many people, will centralized sources large enough to generate real advertising and subscriber revenue survive? Can AP, Reuters, CNN or any other large privately funded news organization survive in the coming climate?

Some say what’s most alarming about the situation is the notion that fair use is per policy being thrown out altogether which could set a dangerous precedent.

LINK: Interview about Data Grids by Ryan Slobojan w/ Cameron Purdy, VP Development at Oracle

Interview with Cameron Purdy, VP Development at Oracle, about data grids. Interesting insights, and several things I’ve been saying for a good while. 🙂

Innovation Process: Limitations of Schemas

Once upon a time, I took a college class on interpersonal communications. We discussed schemas upon which the brain operates. Interestingly, in marketing – the subject designed among other things to manipulate or aid in the manipulation of the human psyche for increased profit – we discussed schemas upon which the brain operates.

Then, in a class on neural networks we discussed why brains both organic and artificial tend to remember the first and last things they learned about a specific topic. Furthermore, we talked about how schemas within these brains operate.

Speaking to a technical crowd: SQL operates upon very rigidly defined schemas. Ordinarily, we have tables with columns defining things like people’s names and addresses and telephone numbers and dates of birth and gender and what have you.

Schemas are wonderfully robotic – if by robotic you mean those old conceptions of robots from 1950’s sci-fi. Simplistic notions of schemas tend to dictate that we approach the world very deterministically, very discretely (and I don’t mean privately) and logically. I say, wrong!

Schemas mean patterns. We and most organisms with neurons learn by association. We start with some hard wired axioms and go from there. Break the pattern, and things become difficult to understand. While most “out of the box” thinking is I might argue pretty boxed in, the theoretical ideal of “out of the box” operation is to go beyond the schemas. Is this possible? I don’t know. But maybe we can combine schemas.

Most attempts at productivity are based on refining operations into consistent, easy to follow schemas. In software design, we use design patterns to enforce models that we can wrap our brains around – or at least – having spent much time banging our heads against walls now have a particular schema thoroughly beaten in … and might as well recycle.

Consistent, reusable schemas are absolutely wonderful for Model T’s, Model F’s and many things that churn down an assembly line. Plenty of simple database-driven software can be built perfectly well with a lot of recycled thought.

Now, there is an antiquated saying in research with words to the effect: Before wasting your time going down a road much travelled to re-invent the wheel, the donut, what have you … see if somebody else has done it first and better. If you’ve got something on a shelf, pull it off and use it. Great. This works 99% of the time when you’re not producing new schemas. There’s a ton of value in evolutionary steps and applying something from one schema into another.

However, once in a while we want to do something revolutionary. We don’t start from zero. We are surrounded by many good schemas; old solutions to old problems should often prevail. Then there comes a time when we must come up with a schema we believe to be genuinely new. New? Is there such a thing as a new schema? I have no idea. I would venture to say there likely is not; all schemas are combinations of others in some way; everything is based upon association of one form or another. I don’t care. I’ll leave this subtle point for the philosophers.

To me, I care about not being constrained by old schemas. The less I know sometimes the better. The less structure I have sometimes the better. I want to look at my problem, flail about, come up with a half-baked solution and then plug the holes with somebody’s tried and true schema.

If I’m operating under tremendous structure, I can’t do this. The wonder of iterative design is in some sense a means to apply my very semi-structured process. Iterative improvement allows one to drift about for a solution, come up with something new and then not waste too much time dawdling on unnecessary details.

That’s my 3.5 + rand( rand(34) )^rand(2/rand(5)) cents. Ironically, this article itself is bound by structure. Go figure.

My Project – Better Information: It’s Coming

As many close to me know, I have spent the last few years working on a largely stealth project. The original idea hatched in late 2005 on a 25 hour journey to visit a friend in Singapore.

The project remains mostly in stealth, but I will make some public comments.

Broadly speaking, today’s information suffers from intentional and unintentional inaccuracy, bias, incompleteness, inconsistency, inefficient presentation and other problems.

I look to bridge the gap between masses of loosely structured information and usable knowledge. Raw data needs to go to real wisdom in your brain … faster.

To this end, my team has explored many solutions both technological and non-technological.

Stay tuned.

Metered Broadband? It’s Not Particularly New or Totally Evil – A Brief Introduction to Commercial Bandwidth Services Pricing

Many consumers are in arms over announcements by several providers that they will begin charging overage rates or limiting data transferred. In fact, much of the hosting industry and higher end commercial solutions provide Internet connectivity on a basis of (1) the physical line and (2) the amount of bandwidth actually used.

For example, a provider might charge $20 a month for a network connection that might have a capacity of a 100 megabits or 1000 megabits per second. The provider might then charge a separate fee depending on how much of that connection is used. Bandwidth is often metered on a megabit per second (8 megabits in a megabyte) or based on the total amount transferred often measured in gigabytes.

When bandwidth is sold on a megabit per second (often abbreviated “mbps”) utilization rate, it is often metered by reading actual bandwidth flowing through the connection every so many minutes. In industry standard 95th percentile billing, the highest 5% of those readings are thrown out. The customer is then billed based on the “sustained 95th percentile”.

Under 95th percentile assuming a monthly billing cycle, the customer could in principle use much more bandwidth than usual for up to about 36 hours and would not be billed for the increased amount. So, the 5% in 95th percentile lets customers retain some flexibility for less frequent “bursts”.

Per “bucket” or “data transferred” billing is just so much money per gigabyte (or other amount).

Customers typically pay for:
(1) the line –
Physical line or uplink to provider.
(2) commit –
The amount of bandwidth for which the customer agrees typically over some contract term to purchase. This bandwidth is sold at a “commit rate” which is often less expensive than the overage rate.
(3) overage –
The amount of bandwidth over the commit rate. Overage bandwidth is sold at an “overage rate” which is often double or so the commit rate.

Higher overage vs. commit rates encourage customers to take on larger commits ensuring ISPs can better plan their infrastructure. Higher overage rates also account for the inherently often higher cost and over provisioning necessary to provide services when demand is less predictable.

A service provider that has unpredictable bandwidth utilization must choose among (1) over provisioning infrastructure and charging more money for services or (2) providing a lower quality of service particularly at peak times and likely cutting corners elsewhere.

A service provider that has many customers all paying the same rate but using very different amounts of bandwidth must (1) charge all customers higher rates or (2) deliver a lower overall quality of service to all customers.

Your power is metered. Your cell phone is metered. You pay for the gasoline you burn in a car. You choose whether to buy expensive or inexpensive products. You choose the nature and quality of what you consume often based on what you’re willing to pay.

In spite of some of the uproar, I believe that charging for or even capping bandwidth based on usage is in fact fair. Implemented properly, such efforts could result in a higher quality of service for all consumers.

The key issue should be whether prices charged for overage and larger commits are fair.