
On Wed, Jun 15, 2011 at 6:51 AM, Kazu Yamamoto
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)
Is this to get the increased performance of the sendfile system call? I very much doubt it would work out faster. With embedded files, the entire static file is stored as a contiguous chunk of memory. It's worth an analysis before recommending this approach, of coruse. Michael
--Kazu
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel