HNHacker News
TopNewBestAskShowJobs

rtm

195 karma · joined October 9, 2006

submissionscomments
rtm··on HN will be down Saturday morning while we switch servers
Old server: two Xeon E5450 chips, 3.0 GHz, 8 cores total, 24 GB RAM.

New server: one Xeon E5-2690 chip, 2.9 GHz, 8 cores total, 32 GB RAM.

rtm··on [dead]
Test comment.
rtm··on Acer C7 Chromebook review
xxxxx
rtm··on Unix v6 Ported to ANSI C
Address spaces based on paging rather than segments. Much clearer context switching code. File system crash recovery via logging.
rtm··on Unix v6 Ported to ANSI C
Most students take 6.828 along with three or four other courses.
rtm··on Unix v6 Ported to ANSI C
http://pdos.csail.mit.edu/6.828/2011/schedule.html
rtm··on Ask HN: If you think ideas are not worth a dime then post yours here
xxx
rtm··on Analysis of the Google Phone
Test 2.
rtm··on Analysis of the Google Phone
Test 1.
rtm··on Virtual goods: "precisely what you'd expect to evolve on the iPhone"
Testing.
rtm··on Ask HN - Why was there ever, fork() ?
fork() and exec() work well as separate system calls for the common situation where the child (but not the parent) needs to adjust something before executing the new program. Changing file descriptors to implement > and < in the shell, for example. It's common to see sequences like

  pid = fork();
  if(pid == 0){
    close(1);
    dup(pipefds[1]);
    exec(...);
  }
rtm··on Why Startups Fail and Why Gigamon Should've Too
this is a test. I think you have already honed in on the basics: "You have to actually do it". If it seems like there are too many things to try and they all look appealing, you just need to understand yourself better and self observation will help you there.

You are wrong to suggest that we grow to like anything life forces us to do. If you have an analytical mind, a job flipping burgers or pressing buttons as a tester is never going to satisfy you. You might be able to change the job to something you like more (e.g. write test scripts) but that's a whole other topic.

Some additional things I have learnt that may be useful for you are: (1) There is no one thing predestined to be your calling in life, there are several things you may like. (2) If you really want something, you'll usually get it eventually or find something that you like better.

It is useful to set a long term goal based on what you know you like so far and at least initially, while you are still in college, it is useful to state it broadly but don't tie yourself to a specific way of getting to that goal.

For example, I know I enjoy coding, technology, business and teaching. There are several combinations of these that could end up being my calling. The specific image I may have in mind is to work as an engineer / technical entrepreneur now and become a I think you have already honed in on the basics: "You have to actually do it". If it seems like there are too many things to try and they all look appealing, you just need to understand yourself better and self observation will help you there.

You are wrong to suggest that we grow to like anything life forces us to do. If you have an analytical mind, a job flipping burgers or pressing buttons as a tester is never going to satisfy you. You might be able to change the job to something you like more (e.g. write test scripts) but that's a whole other topic.

Some additional things I have learnt that may be useful for you are: (1) There is no one thing predestined to be your calling in life, there are several things you may like. (2) If you really want something, you'll usually get it eventually or find something that you like better.

It is useful to set a long term goal based on what you know you like so far and at least initially, while you are still in college, it is useful to state it broadly but don't tie yourself to a specific way of getting to that goal. NEW END.

rtm··on Yay! Hacker News is on a new and improved server now.
64-bit mzscheme uses about 50% more memory than 32-bit mzscheme to hold all of the Hacker News data.
rtm··on Yay! Hacker News is on a new and improved server now.
Old: 2.4 GHz Pentium 4, 4 GB RAM, 32-bit FreeBSD 5.3.

New: 3.0 GHz Core whatever, 12 GB RAM, 64-bit FreeBSD 7.1.

rtm··on Applications open for summer 2009 YC funding
Nonsense.
rtm··on [dead]
foof
rtm··on Paul Buchheit: The secret to making things easy: avoid hard problems
I ran the test with 1,000,000 INSERTs (taking 200 seconds), with the innodb cache size set to only 200,000 bytes. So there's a fair chance it updated the b-trees on disk.
rtm··on Paul Buchheit: The secret to making things easy: avoid hard problems
167 small transactions per second on MySQL 4.1 / InnoDB / FreeBSD / FFS / SCSI, which looks like one per rotation. Presumably the time required to write a block at the end of the write-ahead log.

5000 per second with --innodb_flush_log_at_trx_commit=0, which only writes the log to disk once per second.

The MySQL documentation claims that this configuration does crash-recovery correctly, though you may lose the last second's worth of transactions.

rtm··on The problem with conventional databases
On MySQL 4.1 / InnoDB / FreeBSD / FFS / SCSI, small inserts run at about 167 transactions per second, i.e. one per rotation.

Same setup but --innodb_flush_log_at_trx_commit=0, a million transactions in 200 seconds, or 5000/second.

I don't know if InnoDB wrote its B-Tree to disk during the 200 seconds. Same performance even with InnoDB's buffer pool size set to 200 KB with --innodb_buffer_pool_size=200000.

The MySQL documentation claims that this configuration does crash-recovery correctly, though you may lose the last second's worth of transactions.

rtm··on The problem with conventional databases
The drives whose documentation I've read say they may not copy the write-cache to the surface during a power failure. I don't know about other drives, or about why.

Such a feature would anyway be hard or impossible to use as part of a design to get fast writes and crash recovery. Crash recovery usually depends on constraints on the order writes were applied to the disk surface -- for example that all the log blocks were on the surface before any of the B-Tree blocks. Or (for FFS) that an i-node initialization goes to the surface before the new directory entry during a creat(). Drives that just provide write caching don't guarantee any ordering (much of the point of write-caching is to change the order of writes), and don't tell the o/s which writes have actually completed. So the write-order invariants that crash recovery depends on won't hold with write-caching. That's why tagged command queuing is popular in high-end systems: TCQ lets the drive re-order concurrent writes, but tells the o/s when each completes, so for example a DB can wait for the log writes to reach the surface before starting the B-Tree writes.

In our case, perhaps a pure log-structured DB could use a disk write-cache. Crash recovery could scan the whole disk (or some guess about the tail of the log) looking for records that were written, and use the largest complete prefix of the log. But we would not be able to use the disk for anything with a more traditional crash recovery design -- for example we probably could not store our log in a file system! Perhaps we could tell the disk to write-cache our data, but not the file system's meta-data. On the other hand perhaps we'd want to write the log to the raw disk anyway, since we don't want to be slowed down by the file system adding block numbers to the i-node whenever we append the log.

rtm··on The problem with conventional databases
You can configure a drive to delay writing to the disk surface, and instead just write into its cache, until some later point when it's convenient to write the surface. But the reason a DB issues a write to the disk is that the DB needs the data to be recoverable after a crash before the DB can proceed. So DBs cannot easily use the disk's write-to-cache feature; the disk's cache is no more durable than main memory.

You might imagine that the disk would write-cache only an amount of data that it could write to the surface with the energy stored in its capacitors after it detected a power failure. But this is not the way disks work. Typical disk specs explicitly say that the contents of the write-cache may be lost if the power fails.

You may be thinking of "tagged queuing", in which the o/s can issue concurrent operations to the disk, and the disk chooses the order in which to apply them to the surface, and tells the o/s as each completes so the DB knows which transaction can now continue. That's a good idea if there are concurrent transactions and the DB is basically doing writes to random disk positions. In the log-append case we're talking about, tagged queuing is only going to make a difference if we hand lots of appends to the disk at the same time. In that specialized situation it's somewhat faster to issue a single big disk write. You need to defer log flushes in either case to get good performance.

rtm··on The problem with conventional databases
Deferred logging is a huge deal! Appending a record to a log takes one (or a half) of a rotation. A rotation takes about the same amount of time as a disk seek. So a DB that synchronously appends the on-disk log for each transaction will be slow.

The huge win is if you can append many transactions to the log in each rotation. To do that you have to gather up many updates per disk operation. So deferred logging is critical.

I suspect the reason PostgreSQL doesn't really support delayed log flush is that they are thinking about ACID transactions, where you really need the data to be on disk immediately. A more technical issue is that the log data must be on disk before the corresponding permanent data (otherwise crash recovery will break), and I suspect postgresql.conf's "fsync" option has the effect of not fsync()ing the log at all, which indeed would cause permanent corruption after a crash.

rtm··on The problem with conventional databases
An ordinary DB writes each update to disk twice, once in the log and once in the permanent DB. DBs do defer updating the permanent DB. But they tend to be eager about flushing the log in order to achieve durability. If you read the documentation for PostgreSQL, for example, the only knob that seems to allow you to defer log flushes also says it may corrupt the internals of the DB if there's a crash. (Though there's no fundamental reason PostgreSQL couldn't defer log writes and have correct crash recovery, sacrificing only durability of recent updates.)
rtm··on The problem with conventional databases
A challenge in a pure version of a log-structured database is reclaiming space from the log when data is no longer needed. Sometimes you don't need to, as in Venti ( http://citeseer.ist.psu.edu/531029.html ).
rtm··on Hard disc test surprises Google
I wonder what this means for practical system design. Do people currently build assumptions about hard drive failure patterns into their systems, in a way that they should change? I suppose independent failure (i.e. copying data to two drives is better than storing it on just one) is the main assumption behind e.g. RAID; I wonder whether Google has any new insight there.