resize_fdtable

Function resize_fdtable 

Source
pub fn resize_fdtable() -> Result<(), ResizeFdTableError>
Expand description

Attempts to resize the processes file descriptor table to match RLIMIT_NOFILE or 2048 if no RLIMIT_NOFILE is set (this can only happen if firecracker is run outside the jailer. 2048 is the default the jailer would set).

We do this resizing because the kernel default is 64, with a reallocation happening whenever the tabel fills up. This was happening for some larger microVMs, and reallocating the fdtable while a lot of file descriptors are active (due to being eventfds/timerfds registered to epoll) incurs a penalty of 30ms-70ms on the snapshot restore path.