
15 Jun
2011
15 Jun
'11
3:51 a.m.
I'm really starting to think that the correct solution for this use case really is embedded files[1]. It avoids any kind of system call overhead, doesn't touch the hard drive at all, and doesn't allow for modification of the files after compile time. It would be interesting to see if it ends up faster than sendfile.
This is just my idea. Not confirmed. The server saves all embedded files to the file sytem on boot time and obtains file descriptors for them. And it *unlink* files so that nobody but the server can touch. Then the server can send the file with sendfile. (sendfile API should take FD not FilePath) --Kazu