On Mon, Feb 2, 2015 at 7:45 PM, Tomasz Chmielewski <man...@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
_______________________________________________
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to