Lxd resource allocation suggestions for webserver

I was running Centos 6 with Virtualbox for 2 xenial-vm-webservers (1 CPU/512 MB RAM) very light static pages and low traffic. Host is 8-core Intel® Xeon® CPU E3-1240 V2 @ 3.40GHz with 12 GB RAM (mainly a samba server)(Dell poweredgeT110 II).All was OK.
Migrated everything to Xenial with 2 xenial-vm-webservers. Now everyday when unattended-upgrades (has a real package installation) are running in baremetalhost there is info - and I cant reach the webservers.

INFO: task apache2:18083 blocked for more than 120 seconds.

We have gigabit ethernet connected through German National Research and Education Network https://www.dfn.de/en/ so it is definitely not a network issue.

I even increased the RAM and CPU allowance.

lxc config set www1 limits.memory 1024MB
lxc config set www1 limits.cpu 2

Even then apache gets blocked at this time. This never happened before with virtualbox. I assumed that lxd(lxc) must consume less resources and hence must not get blocked or am I mistaken? host Root is EXT4 and data in ZFS.

Any suggestions. Thanks

sysctl -a
vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 10
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 20
vm.dirty_writeback_centisecs = 500
vm.dirtytime_expire_seconds = 43200
1 Like

I think that there should be some Linux kernel message (dmesg) that would explain the blocking.
For example, it could be an issue with the storage device that manifests itself as the blocking to the Apache server.

Can you check your kernel messages for any kernel oops?
See whether you find messages similar to those at https://github.com/zfsonlinux/zfs/issues/7691

Looks like the bug you referenced. I will wait until xenial kernel updates.

I am confused, a bit. Is this a kernel bug or ZFS code bug? Does it mean if I install this PPA/xenial that provides 0.7.11 ZFS version I can solve it? Thanks

https://launchpad.net/~jonathonf/+archive/ubuntu/zfs

Might be best to just use the Ubuntu 18.04 kernel instead, you can do that by installing the linux-signed-generic-hwe-16.04 package, that should get you 4.15.

Xenial and newer Ubuntu versions have ZFS support in the kernel.
Therefore, if you run the stock Ubuntu Linux kernel, you already have ZFS support.

The other way to get ZFS support in Linux you would need to run ZFS using DKMS. The ZFS PPA uses DKMS.

When I was testing LXD and noticed this ZFS bug, I would remove the stock ZFS kernel modules and compile the newest ZFS from source. And ZFS would work fine.
In your case, if you were to use the PPA, first remove the stock ZFS kernel modules.

As far as I know, Bionic got already the ZFS update so if you do sudo apt upgrade you will get the updated packages. For Xenial, the new kernel packages were in the -proposed repository and are expected (or are already there) to make it as a kernel update.