lcow icon indicating copy to clipboard operation
lcow copied to clipboard

File ULIMITs for Linux containers

Open dwrightpulse opened this issue 5 years ago • 10 comments

Hi,

I'm working on a PoC build to run Linux and Windows-based containers side by side on WS2019. To enable the side by side nature I have deployed the WS2019 host as per the instructions at https://github.com/linuxkit/lcow, using dockerd.exe and docker.exe from the master project from 13/02/19 and the v4.14.35-v0.3.9 release for the initrd.img and kernel files.

I can successfully run Linux containers, but when running the influxdb:1.7.4 container from https://hub.docker.com/_/influxdb, and writing to the database the console output report that it is unable to write data due to too many open files in use. We use this image in Azure ACI and have no issues with it.

Having done some investigation, the ULIMIT for files in the running container when running in LCOW on the 2019 host are 1024 and when running in ACI or Docker Desktop on Win 10-1809, the limits are over 1 million (see attached screenshots)

ulimit influx in azure influx ulimit in docker desktop ulimit influx in docker lcow on ws2019

I'm posting here as concluding this is an issue with the LinuxKit kernel that this solution uses. I have tried to see if I can use alternate kernel files to confirm if this is the issue (https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers suggested Kata and Clear Linux kernels (but I have got nowhere with these 2 options so far)) and I am unable to over-ride the default files ulimit in the daemon.json file (as per https://docs.docker.com/engine/reference/commandline/dockerd/) as when starting the dockerd daemon it reports that this is not configurable in Windows (see further attached screenshot)

default-ulimit in docker lcow on ws2019

As a way of progressing, I'm happy to try the Kata or Clear kernel option if anyone can give me some guidance on how to get hold of the right files and configure LCOW to use them....

dwrightpulse avatar Mar 01 '19 09:03 dwrightpulse

That limit will need to be set in https://github.com/Microsoft/opengcs/blob/master/init/init.c so you may want to open an issue there.

justincormack avatar Mar 01 '19 10:03 justincormack

Thanks Justin, I'll do that...

dwrightpulse avatar Mar 01 '19 11:03 dwrightpulse

We can increase the default there, but we should also fix Docker to support —ulimit and —default-ulimit when LCOW is supported. @jhowardmsft

jstarks avatar Mar 02 '19 15:03 jstarks

@jhowardmsft @jstarks - Any update on this please?

dwrightpulse avatar Mar 15 '19 14:03 dwrightpulse

Working on higher priority stuff right now. It’s on the list

lowenna avatar Mar 15 '19 15:03 lowenna

Thanks John, any idea on timescale. My PoC timescale is end of May, is that feasible?

dwrightpulse avatar Mar 15 '19 15:03 dwrightpulse

I can’t provide any timescale.

lowenna avatar Mar 15 '19 15:03 lowenna

OK, can you give any input on using alternate kernels within LCOW to see if this circumvents the issue?

dwrightpulse avatar Mar 15 '19 15:03 dwrightpulse

Not really. I was going to look at fixing it from moby not via an alt kernel

lowenna avatar Mar 15 '19 15:03 lowenna

@jhowardmsft - are you any closer to fixing this in Moby?

Will the Build announcements ref WSL2 have any effect on how this is implemented in the future?

dwrightpulse avatar May 15 '19 14:05 dwrightpulse