What's with sync mouting?

The other day, I really noticed something for the first time. I realized the complete and total suckiness of synchronous mounting.

As you may or may not be aware, I use autofs to access my removable media, including my USB flash drives. I also have my autofs rules set up to mount volumes synchronously, so that when the writing is done, I can just yank the drive out, secure in the knowledge that there won't be any pending writes.

Well, earlier this week, I downloaded a couple of MP3s and decided to take them to work with me. They only totaled about 20MB, so I decided to put them on my JumpDrive. Putting this much data on my JumpDrive at once is actually pretty rare for me. Since the drive is only 32MB, I usually only put small files (< 1MB) on it and transport things like MP3s on CDs.

Well, when I started copying the MP3s, I noticed that the process was going slow. Unreasonably slow. I'm talking about transfer rates of 32KB per second, with an estimated completion time of 20 minutes. Now, I don't know much about USB flash drives, but I knew this couldn't possibly be right.

Well, a little experimenting revealed that the synchronous writes were the problem. When I mount a volume asynchronously, there is no problem at all and the write finishes in less than a minute. What's the deal with that? It's one thing to have a performance penalty associated with synchronous writing, but I'm just floored by the sheer magnitude of that penalty. I mean, 32KB per second?!? I can get faster transfer rates over a network! Why are the writes so slow? There must be some rational explanation for this.

You can reply to this entry by leaving a comment below. You can send TrackBack pings to this URL. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.