RAID 101 [Permalink]
The information for this post was taken from this article. The article discusses much more than just "what is raid". It also details how to run software raid using Linux. As I just want to post about RAID 101, i've boiled down a few useful bits here. This is not going to tell you how to run RAID, only what it is.
RAID - Redundant Arrays of Inexpensivbe Disks
RAID is not a substitute for backups.
RAID is good for: the ability to combine several physical disks into one larger "virtual" device, performance improvements, and redundancy.
RAID is NOT good if: the RAID itself is lost in one way or the other (theft, flooding, earthquake, Martian invasion etc.)
N is used to denote the number of active disks in the array (not counting spare-disks).
S is the size of the smallest drive in the array.
P is used as the performance of one disk in the array, in MB/s.
S is the size of the smallest drive in the array.
P is used as the performance of one disk in the array, in MB/s.
- RAID-0
- The devices should (but need not) have the same size.
- If one device is much larger than the other devices, that extra space is still utilized in the RAID device, but you will be accessing this larger disk alone, during writes in the high end of your RAID device. This of course hurts performance.
- there is no redundancy
- [why use? combine several smaller drives as one larger drive. useful when combined with raid-1]
- RAID-1
- has redundancy
- can be used on two or more disks with zero or more spare-disks
- maintains an exact mirror of the information on one disk on the other disk(s)
- the disks must be of equal size. If one disk is larger than another, your RAID device will be the size of the smallest disk.
- If up to N-1 disks are removed (or crashes), all data are still intact
- reconstruction of the mirror will immediately begin on one of the spare disks, after detection of the drive fault
- Write performance is often worse than on a single device, because identical copies of the data written must be sent to every disk in the array
- RAID-5
- can be used on three or more disks, with zero or more spare-disks
- size will be (N-1)*S
- parity information is distributed evenly among the participating drives (parity information can be used to reconstruct all data)
- If one of the disks fail, all data are still intact
- If spare disks are available, reconstruction will begin immediately after the device failure
- Both read and write performance usually increase
Posted by shawker on Monday, 28 July 2008
Tags: software tip
Comments (0)
Tags: software tip
Comments (0)
Rosy-Lipped Batfish [Permalink]
![]() |
Leia: You rosy lipped ... batfish!
Han: Who's rosy lipped? Luann thought the name of this sea creature would make an especially good insult to throw around at some point. I couldn't agree more! Oh, and this is a real sea creature. I ran across it on the National Geographic website. |
Posted by shawker on Thursday, 24 July 2008
Tags: cool humor photography star wars
Comments (2)
Tags: cool humor photography star wars
Comments (2)
Curses, dream scribe! [Permalink]
A few nights ago i put a pad of paper and a pen on the nightstand next to my bed and determined that i would write down some of my dreams so that i could recall them the next day. I can't say for sure, but it seems that they've been rather interesting lately. Maybe they'll give me good ideas for a short story. *shrug*
Well, as the night progressed, i woke up a time or two and scribbled something on the pad of paper - i remember this quite clearly. When morning came, i woke up and picked up the pad of paper - eager to see what my subconscious had dreamed up over the course of the night. What grand adventures had I undertaken?
My wife gave me a curious look as i cursed the paper held in my hands. Then she started to laugh as i showed her my nights efforts: a big fat blank piece of paper. All those scribbled notes were just imagined! Curse you dream scribe!
Update:
Found a great comic that seemed quite pertinent: xkcd - 430
Posted by shawker on Tuesday, 15 July 2008
Tags: dream writing
Comments (3)
Tags: dream writing
Comments (3)
The stinky cow [Permalink]
![]() |
Ok, this is too good to pass up... I actually think there might be some merit to studying something like this. But wow, the comments had me busting up :) I'll include a few of them here for you. :)
|
Posted by shawker on Friday, 11 July 2008
Tags: science cows humor
Comments (0)
Tags: science cows humor
Comments (0)
Let the games begin! [Permalink]
An article came across my reader yesterday that caught my attention. "All video games to be free". Holy crazy-talk batman. Did you just say that all video games will be free? Considering that the computer gaming industry is a multi-billion dollar a year industry, i was quite skeptical as to how this could be. So i read on...
The article starts out saying that the gaming industry loses a bazillion dollars a year due to pirating. In order to combat this, some companies (mostly in Japan right now) are giving away their games for free. Yes, that's right - you can just go to the website and download the game.
Sounds great for the consumer. And maybe the company is getting gamer good-will, but ... that's not a very good business model. So what's in it for the companies that are doing this? I'll get to that in just a minute. That's the really interesting and innovative part.
But first: the article goes on to say that because some companies are starting this, eventually it will spill over and all companies will HAVE to give their games away for free, because why would you pay $50 for a game when you can get another equally fun game for free? Good point.
Ok, so how can a game company give away games for free and hope to survive? Enter "micropayments". Even though you can play the game for free (or at least part of it), it's all the accessories and extras that you will buy to enhance your experience that will fill the game company coffers. Suppose you're playing a racing game. You want a red car with a super cool flame paint job? $1.00. How about a t-shirt for your character with your face on it? Another $1.00. Walk into the virtual game-store and buy that barbarian character of yours a wicked-cool two-handed longsword of slaying for $1.75. Brilliant! I can totally see this taking off. There's already precedent for this in second life where people sell virtual goods/services for real-world cash.
What do you think - genius or madness?
Posted by shawker on Friday, 11 July 2008
Tags: games software
Comments (0)
Tags: games software
Comments (0)
Apollo moon rocks hold water [Permalink]
According to several blog articles that have come across my reader the last two days, water has been found inside of some of the moon rocks that were returned by the Apollo missions back in the 60's and 70's.
But wait - hasn't NASA plunged a few satellites into the moon in the recent past in order to find water at the moon's poles? Yes, but the results were inconclusive.
Why did it take so long to notice water in the moon rocks? I don't know, but it's pretty cool that people are still studying these rocks 30+ years later and still finding new things.
National Geographic Article
Space.com Article
Space.com Article
Posted by shawker on Thursday, 10 July 2008
Tags: space nasa
Comments (0)
Tags: space nasa
Comments (0)
Python file upload [Permalink]
Not only am I using C++ at my new job, but i'm also doing some Perl and some Python. I actually have found that I rather like Python. It's a great language for what we're using it for. As an aside that has nothing to do with this blog post, this link shows the most popular programming languages. I am using 7 of the top 20 (as of July 2008) programming languages right now. :)
Anyway, back to the point of this post: I was very surprised to learn that Python 2.5x does not have support for uploading binary files over http (i.e. it can't do file upload). What? That's crazy. I happen to need this functionality for a task i'm working on. After some searching, i was able to pull together a bunch of pieces on the net and get a custom solution working. Many sites had pieces of the puzzle, but nobody had an entire working example all put together. Anyway, here is my solution:
import os, stat, mimetypes, httplib
def post_multipart(host, selector, fields, files):
"""
Post fields and files to an http host as multipart/form-data.
@param host: the hostname of the server to connect to. For example: www.myserver.com
@param selector: where to go on the host. For example: cgi-bin/myscript.pl or blog/upload, etc..
@param fields: a sequence of (name, value) elements for regular form fields. For example:
[("vals", "16,18,19"), ("foo", "bar")]
@param files: a sequence of (name, file) elements for data to be uploaded as files. For example:
[ ("mugshot", open("/images/me.jpg", "rb")) ]
@return: the server's response page.
"""
content_type, body = _encode_multipart_formdata(fields, files)
h = httplib.HTTPConnection(host)
headers = {
'User-Agent': 'python_multipart_caller',
'Content-Type': content_type
}
h.request('POST', selector, body, headers)
res = h.getresponse()
return res.read()
def _encode_multipart_formdata(fields, files):
"""
@return: (content_type, body) ready for httplib.HTTP instance
"""
BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
CRLF = '\r\n'
L = []
for (key, value) in fields:
L.append('--' + BOUNDARY)
L.append('Content-Disposition: form-data; name="%s"' % key)
L.append('')
L.append(value)
for (key, fd) in files:
file_size = os.fstat(fd.fileno())[stat.ST_SIZE]
filename = fd.name.split('/')[-1]
contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
L.append('--%s' % BOUNDARY)
L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
L.append('Content-Type: %s' % contenttype)
fd.seek(0)
L.append('\r\n' + fd.read())
L.append('--' + BOUNDARY + '--')
L.append('')
body = CRLF.join(L)
content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
return content_type, body
if __name__ == '__main__':
post_multipart("my.server.com", "/cgi-bin/uploadphoto.pl", [("foo", "bar")], [("mugshot", open("/images/me.jpg", "rb"))])
Posted by shawker on Wednesday, 9 July 2008
Tags: software tip
Comments (0)
Tags: software tip
Comments (0)
My, what a lovely sphere you have [Permalink]
What do metrologists, a lump of platinum in Paris, optical interferometers and crystallographers all have in common right now?
If you answered "How much -- exactly -- does a kilogram weigh?", you are correct!
The kilogram is the only standard weight of measurement that is only defined by one objecft: a lump of platinum in Paris. And for an unknown reason its weight is changing (relative to other copies of itself from around the world). In an effort to officially define a kilogram, a group of engineers has built the world's roundest objects and other scientists are attempting to count the number of atoms in the spheres, which will give an exact measurement of just what a kilogram means going forward.
I'm not exactly sure how they decided how big to make the spheres, but my guess is that they have the same weight as the lump of platinum in Paris, and by counting the number of atoms in the sphere, the lump in Paris will no longer be necessary in case it continues to change its weight or gets lost or stolen, etc.. Find out more here.
If you answered "How much -- exactly -- does a kilogram weigh?", you are correct!
The kilogram is the only standard weight of measurement that is only defined by one objecft: a lump of platinum in Paris. And for an unknown reason its weight is changing (relative to other copies of itself from around the world). In an effort to officially define a kilogram, a group of engineers has built the world's roundest objects and other scientists are attempting to count the number of atoms in the spheres, which will give an exact measurement of just what a kilogram means going forward.
I'm not exactly sure how they decided how big to make the spheres, but my guess is that they have the same weight as the lump of platinum in Paris, and by counting the number of atoms in the sphere, the lump in Paris will no longer be necessary in case it continues to change its weight or gets lost or stolen, etc.. Find out more here.
Posted by shawker on Tuesday, 1 July 2008
Tags: science
Comments (0)
Tags: science
Comments (0)




