Static Filesystem
The StaticFSHandler Component manages Filesystem Data / Mime-Types for Static Data Requests.
All Virtual Host dependent file properties will be loaded at startup into static C++ class member Objects / Structs.
The File Data will be mmapped() into Kernel-Space for sendfile() usage when requested.
If a files size is bigger than 2 Megabytes a huge-page for mmap() will be tried to allocate.
Warning
The current volume of files and subdirectories is a performance bottleneck. We must implement subdirectory segmentation in an upcoming release.
Program Logic
Initialization
Loop recursive over files found in Virtual Host dir (from configuration). Add properties to internal C++ Objects / Structs.
All found files will be mmapped() (read into memory) for sendfile() processing.
Get Property
When an HTTP request for a Static File arrives, the file’s properties (e.g. SendfileFD) must be determined / returned by the request-handling code that performs the filesystem lookup.
Due to immutable member Objects / Structs a pointer can be used for parallel read access.