  While there has been exponential improvements in hardware performance over
the years, software performance has lagged behind. The performance-gap is
caused by software inefficiencies, many of which are caused by software bloat.
Software bloat occurs due to the ever increasing, mostly unused, features and
dependencies in a software. Bloat exists in all layers of software, from the
operating system, to the application, resulting in computing resource wastage.
The problem is exacerbated in both cloud and edge setting as the number of
applications running increase. To remove software bloat, multiple debloating
tools have been proposed in the literature. However, these tools do not provide
safety guarantees on the debloated software, with some files needed during
run-time removed. In this paper, We introduce BLAFS, a BLoat-Aware-file system
for containers. BLAFS guarantees debloating safety for both cloud and edge
systems. BLAFS is implemented on top of the Overlay file-system, allowing for
file-system layer sharing across the containers. We compare BLAFS to two
state-of-the-art debloating tools (Cimplifier and Dockerslim), and two
state-of-the-art lazy-loading container snap-shotters for edge systems
(Starlight and eStargz). Our evaluation of real-world containers shows BLAFS
reduces container sizes by up to 97% of the original size, while maintaining
the safety of the containers when other debloating tools fail. We also evaluate
BLAFS's performance in edge settings. It can reduce the container provisioning
time by up to 90% providing comparable bandwidth reductions to lazy-loading
snap-shotters, while removing 97% of the vulnerabilities, and up to 97% less
space on the edge.
