bwindels / wwwee

wwwee, the wee webserver: a small, robust, low-resource and fast web application server for low workloads (home server, personal cloud)
GNU General Public License v3.0
26 stars 1 forks source link

Implement file writer #21

Open bwindels opened 6 years ago

bwindels commented 6 years ago

use linux aio calls and fallocate to implement file::Writer. The file writer will have the constraint that the file size needs to be known in advance (which is fine for uploads as we have a content-length header). This is needed to keep aio from blocking, as extent allocating in the kernel reverts to blocking. A prototype to check with strace how much io_submit blocks in different cases with different file-systems, like done for the file::Reader is probably needed. See https://stackoverflow.com/questions/34572559/asynchronous-io-io-submit-latency-in-ubuntu-linux and https://github.com/littledan/linux-aio/blob/master/README.md.