[lxc-users] writeback cache for all container processes?
Fajar A. Nugraha
list at fajar.net
Mon Feb 2 13:35:42 UTC 2015
On Mon, Feb 2, 2015 at 7:45 PM, Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> On 2015-02-02 21:37, Fajar A. Nugraha wrote:
>
> It's certainly possible to do "not applicable" kinds of things with
>>> processes and their page cache, i.e.:
>>>
>>> https://code.google.com/p/pagecache-mangagement/ [1]
>>>
>>> Or here, disabling O_DIRECT and sync would be sort of matching
>>> "feature-wise" with KVM's cache=writeback:
>>>
>>> http://www.mcgill.org.za/stuff/software/nosync [2]
>>>
>>> Is it possible to set things like this for all processes in a given
>>> lxc container?
>>>
>>
>> What are you trying to achieve?
>>
>
> I'm trying to achieve the equivalent of KVM's cache=writeback (or,
> "libeatmydata / nosync") for the whole container.
>
>
What I meant was, what are you trying to achieve by doing that? The ones
you mentioned are ways to do something, which might not be applicable in
this case.
I assume you want to "disable sync completely, even if it means losing data
on power failure" (which is what eatmydata does).
>
> If you want to disable sync for the container, the best you can do is
>> probably use some filesystem that can do so. For example, zfs has
>> "sync=disabled" per-dataset settings. So you can have "sync=standard"
>> for filesystems used by the host, and "sync=disabled" for filesystems
>> used by containers.
>>
>
> That's a weird advice, given that lxc are Linux containers, and ZFS is not
> in Linux kernel (I know that there are some 3rd party porting attempts, but
> it's not really applicable in many situations).
>
>
Honestly, that's the best advice I can give. It's straightforward, simple,
and works.
There are lots of zfsonlinux users using it on production environment. Even
lxc-create supports zfs as backingstore, to a degree (man lxc-create). And
doing the above is the equivalent of having eatmydata running on everything
that access that dataset.
Other possible solutions that I know of either does not work (e.g.
eatmydata lxc-start ...) or adds additional layers and complexity (e.g.
using an additional layer like iscsi/scst and setting nv_cache=1 on scst)
--
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150202/abad8f8d/attachment.html>
More information about the lxc-users
mailing list