[mythtv] Loud hard drive due to NuppelVideoRecorder.cpp sync()
Sam N. Max (snx)
snx at rogers.com
Fri Jun 13 15:28:38 EDT 2003
----- Original Message -----
From: "Isaac Richards" <ijr at po.cwru.edu>
To: "Development of mythtv" <mythtv-dev at snowman.net>
Sent: Friday, June 13, 2003 11:48 AM
Subject: Re: [mythtv] Loud hard drive due to NuppelVideoRecorder.cpp sync()
> The main issue is that quite a few versions of the kernel _don't_ write
> in-memory buffers to disk in a timely fashion. Without the sync() there,
> I've seen it spool up several hundred MB in to to-write-to-disk buffer,
> decide to dump it all to disk all at once, causing a lot of frame drops,
> Not good. =)
Hmm, on the sytem I'm working on it doesn't seem to cause dropped frames. I
imagine whether it drops frames depends in part on the hdparm settings (both
dma and unmaskirq). When using MJPEG and uncompressed sound, the issue of
writing huge amount at a time becomes more of an issue. I've been using
MPEG4 with MP3 compression, so the default amount of time the file system
holds back data to be written (> 8 seconds I believe with ext3) doesn't lead
to a huge buffer that needs to be written out.
Maybe it would make sense to have some fine-tuning with the sync option.
Allow the choice of either off or every X keyframes?
> > One final thought. Many people seem to have noticed a slow down with
> > version 0.9 (for now I've been sticking with 0.8). I haven't fiddled
> > it yet, but I was wonderring if the "position map" database write that
> > occurs every key frame may be the culprit (it comes right after the
> > call in NuppelVideoRecorder.cpp). There's also the call to the somewhat
> > kludgy looking "KickDatabase" function which I'm not totally sure
> That's every 15 keyframes, which is every 15 seconds or so. Shouldn't be
Ah, I see. Yeah, that probably isn't much of an issue assuming there isn't
much latency between the client and server.
> KickDatabase is to ensure that the database connection is alive --
> the mysql client library doesn't retry a query if the connection has
> disconnected for whatever reason.
Hmm, I was thinking it had to do with that. I was looking through the mysql
docs, and from the look of it (at least in the newer versions), it
automatically attempts a reconnect if the connection went down.
Also, there is the "mysql_ping()" function, which seems to do something
similar to what KickDatabase does (though it's probably not so great to have
to deal with mysql-specific functions if you want to be database-independent
in the future).
More information about the mythtv-dev