On Mon, Dec 15, 2003 at 05:31:28AM +0000, Timwi wrote:
Hi Tomasz,
naively judging from your vocabulary it seems that you know quite a bit more about this than I do (heh, I've already said that once in this thread), but I've spotted one thing you definitely forgot, so there may be others hidden within the thicket of your technical terms:
Tomasz Wegrzanowski wrote:
- filesystem resides in kernel and uses extremely very fast context
switches between kernelspace and userspace, database server has to communicate using sockets, what's MUCH slower.
What you're forgetting here is that even if you use file systems, you will still have to use sockets to transfer the data to the webserver, except in the special case where they happen to be on the same machine. Relying on this special case is a serious sacrifice of architectural flexibility. I do not expect the webserver and the database to remain on the same machine for very much longer.
They're not on the same machine any more.
One big DB server + many small apache servers is not the only architecture possible. Of course we have to use what hardware we have available, so moving everything to filesystem is unrealistic at the moment.
But maybe for images and the math cache, it's better to keep everything mirrored in real-time on every server. Then, filesystem-to-socket copying is being done by sendfile() system call. In the most optimal circumstances, it's going to tell network card driver to use disk cache as the source of data to be sent, without moving data around. Reasonably recent Apache should have some option to use it.