[mythtv] ringbuffer.cpp

Jean-Yves Avenard jyavenard at gmail.com
Sat Feb 15 21:53:53 UTC 2014


Hi


On 15 February 2014 03:04, Warpme <warpme at o2.pl> wrote:

>
> dirty_expire_centiseconds (default 3000):
> In hundredths of a second, how long data can be in the page cache before
> it's considered expired and must be written at the next opportunity. Note
> that this default is very long: a full 30 seconds. That means that under
> normal circumstances, unless you write enough to trigger the other pdflush
> method, Linux won't actually commit anything you write until 30 seconds
> later.
>
> So data written to disk will sit in memory until either:
> a) they're more than 30 seconds old, or
> b) the dirty pages have consumed more than 10% of the active, working
> memory.

Going to make some tests here; but that the kernel keep the data in
memory and not flush it to the disk should have no impact in our
situation.
The thread attempting to read from the disk should instead get it from
RAM as it's cached.

So unless there's a bug in the caching code, that can't explain the
behaviour I'm currently seeing

> # ==============================================================
> #
> # dirty_writeback_centisecs
> #
> # The kernel flusher threads will periodically wake up and write `old' data
> # out to disk.  This tunable expresses the interval between those wakeups,
> in
> # 100'ths of a second.
> #
> # Setting this to zero disables periodic writeback altogether.
> # by https://bugzilla.kernel.org/show_bug.cgi?id=12309
> # every 5 sec kernel looks up for dirty status
> # This setting for smooting writebacking. Maybe 100 will be
> # even better.
> # echo 300    > /proc/sys/vm/dirty_writeback_centisecs
> # Default is 500
>
> vm.dirty_writeback_centisecs = 100
>
> # ==============================================================
>
>
> # ==============================================================
> #
> # dirty_background_bytes
> #
> # Contains the amount of dirty memory at which the background kernel
> # flusher threads will start writeback.
> #
> # Note: dirty_background_bytes is the counterpart of dirty_background_ratio.
> Only
> # one of them may be specified at a time. When one sysctl is written it is
> # immediately taken into account to evaluate the dirty memory limits and the
> # other appears as 0 when read.
> #
> # Default is <empty>
>
> vm.dirty_background_bytes = 102400
>
> # ==============================================================
>
>
> # ==============================================================
> #
> # dirty_expire_centisecs
> #
> # This tunable is used to define when dirty data is old enough to be
> eligible
> # for writeout by the kernel flusher threads.  It is expressed in 100'ths
> # of a second.  Data which has been dirty in-memory for longer than this
> # interval will be written out next time a flusher thread wakes up.
> #
> # Default is 3000
>
> vm.dirty_expire_centisecs = 864000
>
> # ==============================================================
>
>
> # ==============================================================
> #
> # dirty_bytes
> #
> # Contains the amount of dirty memory at which a process generating disk
> writes
> # will itself start writeback.
> #
> # Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may
> be
> # specified at a time. When one sysctl is written it is immediately taken
> into
> # account to evaluate the dirty memory limits and the other appears as 0
> when
> # read.
> #
> # Note: the minimum value allowed for dirty_bytes is two pages (in bytes);
> any
> # value lower than this limit will be ignored and the old configuration will
> be
> # retained.
>
> # dirty_bytes = 16777216
>
> # ==============================================================
>
>
> # ==============================================================
> #
> # dirty_ratio
> #
> # Contains, as a percentage of total available memory that contains free
> pages
> # and reclaimable pages, the number of pages at which a process which is
> # generating disk writes will itself start writing out dirty data.
> #
> # The total avaiable memory is not equal to total system memory.
> #
> # Default is 20
>
> vm.dirty_ratio = 2
>
> # ==============================================================
>
>
> # ==============================================================
> #
> # swappiness
> #
> # This control is used to define how aggressive the kernel will swap
> # memory pages.  Higher values will increase agressiveness, lower values
> # decrease the amount of swap.
> #
> # The default value is 60.
>
> vm.swappiness = 0
>
> # ==============================================================
>
> Now, when I move to 4k sector HDD  -default kernel settings seems to be OK.
> Honestly speaking, do don't believe in correlation between sector size and
> pdfluser efficiency - so maybe there is pure coincidence between HDD change
> and good performance on VM defaults. But anyway - You can try to play with
> above knobs...
>
> BTW2: I would love to see this thread in MythTV forums - so I can
> read/replay anywhere via browser - instead of only in mailer program :-p
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org


More information about the mythtv-dev mailing list