Tuesday, November 24, 2009

Green programming

In my tradition of nabbing useful comments - largely as a diary. I've got one from "TheRegister". The original question is why do we need a full copy of Windows in every VMWare virtualization session, ie can't we just share the OS code because 40% of the server is being used up in dealing with this bloat. Well all the obvious answers were there; by using Solaris Zones or FreeBSD Jail then you can but then you don't have Windows. It goes back to the code bloat theme and someone called Captain Thyratron et al  summed it up in a rant:



"Solaris Zones/Containers are pretty good (speaking as a self confessed Solaris fan). Though last time I looked they didn't support migration of a live VM from one machine to another. So pluses/minuses both ways.
Of course, the best thing is to have a self-clustering app that doesn't need something like VMWare to give it resiliance, etc. et. You could run such an app natively on a series of hosts in their nice multitasking operating systems. Now where would I get one of those...
I'm pretty sure that virtualisation is just an excuse for lazy developers to not think about their app design properly. I see developers at my employer doing all sorts of crazy things - e.g. a whole Windows VM just to serve up a 10 page website! Whatever happened to efficiency?
Dear Reg, please can you start a Campaign for Real Computing. Once upon a time programmers were skilled at developing efficient code that ran quick in small amounts of RAM. Now that resources are 'plentiful' the programming community has generally got lazy:
1. VMs where a native app would do.
2. Languages with bloated runtime environments that take forever to load just so you don't have to worry about errant pointers.
3. Apps running as crappy interpreted code in junk scripting languages in browsers just to save the effort of compiling the bloody thing.
4. New thin client technologies that consume vast amounts of bandwidth and give poor results instead of updating perfectly good things like X11.
5. An ever expanding array of app hosting environments (Silverlight, AIR, etc.) that are all 'indispensible' that make machines slow to boot and don't do anything that a carefully written native app couldn't do.
6. Data stored in man readable text when computers learnt to store things as binary a long time ago (come on, who EVER reads XML as the prime means of accessing the data within?).
I wonder how long it will be before data centre managers realise that lazy developers and vendors are costing them huge amounts in electricity, hardware and bandwidth costs?"
So there you have it - and it's true. Bloaty programming has a hardware and energy consumption cost. Ending code bloat is green. Do we really need items 1 to 6? I don't think so. This is why I'm anti code bloat and why someone telling me that throwing hardware at it is cheaper than doing the app right in the first place is plain crazy. It may be cheaper (debatable) but it's wasteful and short sighted.

Sphere: Related Content

Monday, November 16, 2009

Peak Oil Baloney


Well there is a peak oil cult currently exemplified by the worriers at theoildrum.com and their latest post, relying pretty much on a correlation between dollar price and US GDP. Hence to them a high oil price equals low GDP. Hence it's basically yet another "doomsday from resource-limits" cult. Well my comment to that is below:
You may be mixing up cause and effect and oversimplifying. Yes GDP is correlated with oil price but that's partly because in a boom more oil is used and in a recession there is a cutback. While I'd accept that a price spike causes a cutback too, the short-term price spikes of 2007 were really caused by over-buying of futures contracts which then corrected the same year. But the reason everyone was buying into oil was because the debt level became unsustainable, the recession was coming, the stock market was diving and the pension fund managers stupidly thought that commodities were a safe haven. Inevitably the speculation corrected and the oil price dropped. The initial price rise from 2001 had of course been caused by the Iraq war and fears of supply.
Of course, we also have the reality that cheap oil allowed globalization by reducing shipping costs which then caused a slump in Western manufacture, so the Western GDP was then propped up only by rising house prices which were in turn based on cheap debt. And of course an economy that depends on house prices to continually rise is doomed to collapse, which is what happened. So it's all a bit more complex than your simple analysis allows for. In other words, correlation is not causation.
Indeed a higher price may actually be better for western economies because:
a) It makes cheap imports more expensive and allows local economies to redevelop their own manufacturing base, which gives real GDP growth from added value, rather than artificial growth from debt.
b) It encourages investments in extraction or gasification of shale oil and extraction of heavy oil, which are both hugely abundant, as even M. King Hubbert [the originator of the peak oil movement] noted, and which in turn ensures a future supply of oil.
Also perhaps a more important correlation is between the price of gold and the number of barrels it buys, which has hovered around 14 barrels per ounce for a century. So it's likely the variance in the price is more indicative of the value of the dollar than anything else.
Lastly, oil is largely used for transportation and plastics so a reduction in oil would not reduce electrical energy output hence it's not quite as drastic as you suggest. There is plenty of coal and gas to keep the lights on and there are also alternatives to plastics which could be used if plastics became expensive. So it's not all doom and gloom! It really depends on how you want to view things!
But there's yet one more aspect that I forgot to mention there. The fact that world oil is bought in dollars means that every country in the world has to keep a supply, so they buy more dollars as the oil price rises. This allows the US to print more dollars without incurring inflation. It's the petrodollar economy that has propped up the USA since the end of the Bretton-Woods agreement and it basically amounts to the rest of the world giving free money to the USA. This willingness for the rest of the world to soak up dollars is why the USA GDP looked so good and why the debt burden didn't seem to matter to all US administrations since Reagan. In their own words, the growing debt was a sign of confidence in the USA and indeed it was. However that confidence is lost if the dollar tanks. That of course would cause all these foreign dollars to be worthless. Hence the rest of the world are partly forced to keep propping up the dollar or lose the value of their reserves. What a dilemma! China, who hold the largest dollar stash, are coping with this dilemma by buying up all the commodities; metals, oil, uranium that they can get their hands on. Basically they will then not have to worry about any dollar crash and may even be the new hegemony in the world - ousting the USA. The Eastern politicians it seems are a lot more clever than their Western counterparts.
Its much more fascinating when you do real analysis rather than just plotting two curves, noting a correlation and dumbly assuming that A causes B or B causes A, rather than C causing both A and B. More false ideas are spread, and even wars happen, because of this fundamental error than by anything else.

Sphere: Related Content

Saturday, November 14, 2009

UK Energy Policy


I'm pretty sure that the UK energy policy is based on faith, hope and charity and very little real action. However, in some senses you can argue that a government with a total lack of engineering knowledge should just keep their nose out. Certainly Thatcher's dreams of a nuclear future were confounded by the reality of commissioning and decommissioning costs and it was largely good luck that natural gas came along at the right time. The gas plants though were not only better than coal and nuclear - simpler, more efficient, cheaper - they were pulled from industry rather than pushed by government. That's an important thing to note as it sort of vindicates the "free-market knows best" idea which has been knocked quite a bit. However the real problem with the free market is that it's too free for the criminals and they then gradually take control and ensure that it becomes less free for everyone else. That's where the regulation is needed. If the regulators are criminals too then there's no hope.
I'm convinced that the UK just doesn't have the money for the nuclear expansion they propose - they are massively in debt. Whatever the government says now they'll have to face that reality sooner or later. Sooner I hope.
So what is the real energy direction going to be? Well I'm increasingly finding that it's a lot easier recycling someone else's words when they agree with you. I thought I was such a contrarian that couldn't happen but apparently I'm not so alone. So I dug this out of the comments section of the oil drum. Again I assume it's public domain. I could have reworded it but that would have been pointless and dishonest. It's by the OMGbyWTF anonymous bot:
"The recession is keeping the lights on at the moment. There are a couple of unusual things happening in the UK electricity market at the moment.
The low price of natural gas and large number of CCGT's seem to to be undercutting the price of coal generated electricity, also there are net electricity exports to France as they seem to have a lot of nukes out of service for various reasons.
The UK has wasted its North Sea reserves making cheap electricity with no long term investment in alternatives or storage. LNG import capacity has been built fairly quickly and it I don't see the 'gas glut' lasting for very long. I think the UK needs to get its act sorted on several key areas.
Build more natural gas storage facilities.
Improve thermal efficiency in buildings: insulation and move towards heat pumps starting with those on electric and oil fired heating. External insulation and solar water heating should also be considered.
Adopt the Danish model of multifuel CHP systems burning coal, rubbish, biomass and gas whilst providing district heating. Distributed generation running of gassified waste / coal / natural gas / biogas should provide good security and flexibility. Dump the CO2 and waste heat into greenhouses.
Accelerate construction of replacement nuclear reactors and grid upgrades to add more interconnectors with Europe and accomodate more wind power.
Expand and electrify existing railway services.
Look at potential for coal bed methane / gasification of the coal reserves under the North Sea, from a CO2 perspective this may not seem a good idea by this time there should be plenty of empty oil / gas fields to pump the CO2 into.
Build the Severn Barrage, and uprate and expand if possible existing pumped storage sites.
Roll out electric vehicles as they become available."
The only things I don't agree about are a) the nuclear expansion - on mainly cost grounds, and b) worrying about warming from CO2, which in my view is a very overblown hypothesis, though I accept it's politically correct. Using the CO2 for greenhouses or scavenging is however eminently sensible. However all this is cost but no sign of where the money might come from. Stopping the pointless wars would help. Perhaps a Tobin tax? Or just getting entrepreneurs to fund it rather than government. I'm not too happy about that because energy companies are natural monopolies - they really need strict overseers.

Sphere: Related Content

Thursday, November 05, 2009

Western manufacture decline

This might be a copyright theft but perhaps opinion on blogs are public domain. Anyway I reproduce verbatim a blog post from Dale R McIntyre, PhD on Andy Revkin's dotearth blog. A blog that seems to be frequented mostly nowadays by realists rather than the wooly-minded Malthusians who used to dominate. Several are admitting now that they don't have quite the same belief that scientists know any better than the rest of us about the state of the planet. However, enough about fantasy science, let's focus on real engineering. This post shows that the USA is now facing the same effects of neo-liberalist de-manufacturing that the UK faced in 1980's. It's difficult to say if it's avoidable or not but it's worth chronicling at least - especially the part about cheap and nasty Chinese cheese-like steel which we've all become accustomed to encountering in household items. When will a major engineering catastrophe occur because of that short-termist thinking?

"Those of us who have tried to manufacture anything here in the US over the last 20 years could explain it to you. The manufacturing skills and enterprizes which led America to prosperity for over two centuries are in a parlous state.

The causes are many but let me detail some of the high points.

In the mid-1990's, China was allowed to join the World Trade Organization with its currency, the renembi, pegged to the dollar and undervalued by about 30%. (For why this was done, you might enquire to the husband of our current Secretary of State, or to Al Gore.)

With an undervalued currency, labor paid at rates on the order of $1.50 PER DAY, no union work rules and no environmental rules worth mentioning, the leadership of China made mercantilism their national policy and export earnings were the order of the day.

American manufacturing firms were soon putting thousands of man-hours of engineering into their proposals, presenting their best, most finely-honed price, only to be told that they had to meet the "China price". That is, unless they cut their best price 30% to match what the Chinese, with their undervalued currency, could do the job for, the work would go overseas. (For documentation please see Business Week and Fortune articles all through the late 1990's and early 2000's)

US firms who met the China price, hoping to keep business and cash flowing in the door, ended up going bankrupt. I believe I am correct that every single major auto parts supplier in this country has been through bankruptcy.

This attack of the "China price" came on top of twenty years of steady erosion of profitability in the manufacturing sector, due to litigation costs, union work rules and the capital requirements of installing pollution control equipment. America led the world in mandating pollution control all through the 1970's and 1980's, at a time when our competitors faced no such requirements. It came at a price; the hollowing out of America's manufacturing infrastructure.

America's steel industry, once the world's strongest, is just a vestige of its former self. What happened? Steel mills had to put their capital into flue gas scrubbers; Asian mills did not. Union wages made America's steel workers the highest paid in the US, paid 47% more than comparable jobs in other US industries. Until the mills went bankrupt, that is.

Every one of those wind turbines will need a tall steel tower to hold it up in the breeze. The Chinese steel industry is now the world's largest, with huge over-capacity, so they sell their steel cheap. It's not very good steel, but boy is it cheap.

Little critical detail items stopped being made here because of high labor costs, the cost of legal liability and the cost of environmental compliance.

Take fasteners, for instance. Big deal, they're just bolts and nuts, right? Well, Boeing is losing customers for their 787 Dreamliner because there are no domestic suppliers of fasteners to hold the wings on, and the foreign suppliers didn't deliver on time.

Every single blade of every wind turbine will be held on by a circle of about 50 high-strength steel bolts. China makes tons and tons of bolts. They are not very good bolts, and a shocking number of them are of cheap low-strength steel but "decorated" with markings to make them look like high-strength steel bolts.

When cheap bolts are installed in a wind turbine they will fail by metal fatigue and their blades will fly off and impale whatever cow or coyote or farmer happens to be passing by. But you can buy Chinese bolts and you can't buy American bolts any more.

Literally thousands of small forges and foundries have shut down in the last 20-30 years. Zinc and chromium plating shops have been particularly hard hit because of the environmental costs of disposing of the chemical plating baths. All of those steel wind turbine towers will need to be coated or plated; otherwise the towers will buckle in 10 or 12 years due to corrosion damage. Where would we do that here in the US? The Chinese don't do a good job of zinc plating but they do it, and nobody cares much what gets dumped in the rivers.

Finally you will need three very long very stiff fiberglass blades for each turbine. (Dow Corning was a pioneer in glass fiber manufacture, but they were driven into bankruptcy here in the US, over the bogus silicone breast implant lawsuits.)

You need epoxy or polyamide resin to soak the glass fibers in to make fiberglass. The resins are petrochemicals. There has not been a new oil refinery built in this country since 1976, and only one new chemical plant in the same time. Oil and chemicals are bad, right? Lots of lawsuits, no building permits."

Dale R McIntyre, PhD

Sphere: Related Content