[mythtv-users] swappiness

Ian Clark mrrooster at gmail.com
Fri Feb 12 16:37:52 UTC 2016


On 12 February 2016 at 14:07, Marius Schrecker
<marius.schrecker at lyse.net> wrote:
>
>> On Friday, February 12, 2016 14:42 CET, Eric Sharkey <eric at lisaneric.org>
>> wrote:
>>
>> The question you should be asking is if you want swap at all. What
>> sort of "emergencies" are you expecting?
>
> Was thinking that swap might be essential if something /anything / a memory
> leak leaves the system in a OOM state.

Assuming you're not running myth as root you might find
'admin_reserve_bytes' does what you want:

https://www.kernel.org/doc/Documentation/sysctl/vm.txt

This should allow you to log on as root and kill anything that's gone
crazy. (Not used this myself; just found it by google however. ;) )

>  I thought that the result of that
> wpould be a complete lockup of everything, including any dirty pages and the
> only way out would be a hard reset, with risk of disk trashing.
>
I believe on most distros the OOM killer will fire up it's shotgun and
start randomly* terminating things. (Which I'll be honest always seems
a little crazy to me, but it can be disabled).

Assuming you're using a fs with journaling you should be fairly safe
from FS corruption. (If you're really paranoid you could disable async
writing for / which should sort it).

[snip]
>
> So if I forget using an old HD, what would be safer?
>
> 1. A very low swappines (0) and swap partition (or file) on the SSD?
> 2. No swap at all and total relieance on the OOM killer if ever needed?
>
Personally I'd go for 2.

While it's probably not comparable, I've got a quad tuner 4GB machine,
runs myth fe/be, the mysql db and Kodi. (No WM though, just X).
According to munin my max swap use over the last few months is around
600MB. However I do compile myth/kodi from source and suspect it was
when building one or both of those (I just tend to do make -j8 and let
it get on with it).

>
>> 4. What about the rest of /var ? Better on the SSD (where log/ will cause
>> writes) or on the media disk, where it will compete on a small way with
>> access to the media files? On my old system /var/ excluding lib/mythtv was
>> only a few hundred MB in size.
>
Whilst SSD wear is an issue it's not nearly as serious as it was a few
years ago. I'd personally leave it on the SSD to avoid contention with
any recordings.

This article is probably worth a read:

http://thewirecutter.com/reviews/best-ssds/

Cheers,

Ian

* - Well okay, it's not /random/, but still....


More information about the mythtv-users mailing list