Tuesday, March 24, 2009

Working on the road

They take good care of roads in Europe. If you've ever driven through Germany you know that the roads are in great condition. If you've ever driven through Germany you also know that it seems that they are always working on the roads. There is no way to drive through that country without passing large stretches of road work. And that's annoying, you will loose quite some time because of this.

But to keep the roads in good condition it needs to be done. Roads wear pretty quickly. The asphalt wears out, especially in the busy areas. And then the road works start again. Is there no other way?

Once I saw an episode of Thunderbirds where they had this massive machine that just drove over area, burned down anything in it's path and behind it let out a new road. Nice, but not really feasible.

Here's an other idea. Why not replace the top layer, the part that wears, with something like a carpet. Of course not a regular carpet, but a 3-5 cm flexible layer that can be rolled up. The material could be a bit rubber like, and very open so that water (from rain) would drain through. This may wear even faster, but there replacing it will take a lot less work. In one weekend you can do miles and miles of road. Just roll it up and roll out the new layer.

This would still be a big logistical operation. And the rolls would have to be several lanes wide. But the rolls could be transported to a storage area somewhere besides the road. During the transport they can transported 'oblong'. During roll out it is turned 90 degrees to be multiple lane wide.

Get some giant nails in akin a huge nail gun to staple it and you're done...

I know this is wild and bizar idea, but nonetheless, I do feel that there has to be a better way than scraping of the asphalt every 5-15 years and laying a whole new layer.

Wednesday, March 11, 2009

Using ram and batteries to get green and faster Hard Drives

Reducing power usage on hard disks by using ram and batteries

Most computers use hard disks. When it comes to price per Gigabyte that still is the most economical solution. They also use quite a bit of power. Anyone that has ever assembled a low power machine and started adding the watts knows that in particular 3.5 inch HD's use quite a bit. 2.5 inch hard disks (used in laptops) use substantially less, but they are also much more expensive and cannot hold the same amount of data.

The most important reason that these disks use this much power is that the data is placed on so called platters. These platters move around their axis at (commonly) 7200 rpm. So the platters make 7200 rounds each minute.
The disk keep the moving, even if the disk is not accessed. This is partly for speed reasons, spinning up takes time. So if your computer needs to read or write a file, it needs to wait until the disks are spinning. But also this is for durability. Hard disks suffer more wear from spinning up than rotating the platters continuously. Laptop hd's are designed to spin down more often. Therefore they can handle it that power management turns the disk off more often to conserve energy. But that does make them slower as well.

RAM memory is much faster than hard disks and uses a lot less energy. But using RAM is not very smart as RAM is not just much more expensive, it is also volatile. As soon as the power is of, all the data is gone. But RAM is getting cheaper.

If you have a large hard disk, you under most circumstances always use roughly the same set of files. The rest of the files are basically just stored there (hard disks provide storage).

So for a relatively small set of files we keep the disks spinning. We can't use ram for this since RAM is not storage. My idea is to combine disks and RAM to make sure that the disks are spinned down most of the time.

Let's add to a regular HD (say 1 TB) 8 gb of RAM. Now I realise that' s not cheap, but we don't need the fastest and most expensive RAM. Any RAM is already faster then a HD. And now also add a battery.

Now also add to the controller in the disk logic that does the following:
- it keeps every file read in RAM until that RAM is full, when files in RAM get flushed based on how much is needed and the priority a file has. The priority is really a combination of when files are last accessed and how often they are usually accessed. (this sounds like cache, but there is more)
- every file that is written is also written to RAM first. The files don get written to disk yet, the write to the disks is delayed.
- the files that are in delayed write are written to disks when:
- the RAM is getting full (i.e. when the delayed writes > 3.5 Gb)
- on set times during the day (i.e. twice a day)
- when the computer is turned down.
That's where the battery is for. When the computer is turned down, or for any other reason the HD no longer gets power, it flushes the delayed writes to disk. The battery provides the power to complete this task when the power to the HD is cut. Also it keeps the files it has read in memory, for as long as it has power.
That means that if you reboot and there was still enough power in the battery to keep the RAM up, the files it needs to reboot are likely in the RAM part of this disk.. As result, considering that RAM is much faster than disks, the whole boot part gets to be much faster.

The result: in most use cases your computer get's a much faster hard disk that uses a lot less power. The disks are spinned up only when accessing rarely used or overly large files and a few times a day for the scheduled writes and writes of larges files.
As a result you get a hybrid between RAM and storage. It should be much faster and also use a lot less energy. And yet you still get the terabyte of storage.
I think that even with just 4 GB you can achieve this. Of course 8 GB would be more effective.