Have you tried to bump up the block size? It will be a trade off of memory to speed. php excels because it, if I understand right, can use a shortcut, like linux has, to pipe a file directly to a tcp/ip socket.
I think that's right.
----
Then B.I. said, "Hov' remind yourself
nobody built like you, you designed yourself"