Descriptionio,net,os,http: sendfile support
Speeds up static fileserver, avoiding copies userspace.
Basic design:
* io.Copy checks if its read source is a SendfileSource and its
write destination is a SendfileDestination. If so, asks those
for their underlying fds and if that succeeds, does the sendfile.
(io.Copyn not yet done)
Numbers: downloading 14 MB AppEngine Go SDK with ab (Apache Bench)
with 5 threads:
Before/after numbers:
CPU:
user 0m3.910s
sys 0m23.650s
->
user 0m0.720s
sys 0m4.890s
Time taken for tests: 8.906 seconds
->
Time taken for tests: 8.545 seconds
Percentage of the requests served within a certain time (ms)
50% 44
66% 45
75% 46
80% 46
90% 48
95% 51
98% 59
99% 71
100 74 (longest request)
->
50% 42
66% 43
75% 43
80% 44
90% 46
95% 57
98% 62
99% 63
100% 64 (longest request)
Patch Set 1 #Patch Set 2 : diff -r f807f74a59b0 https://go.googlecode.com/hg #Patch Set 3 : diff -r f807f74a59b0 https://go.googlecode.com/hg #
Total comments: 11
Patch Set 4 : diff -r 364e36aeec98 https://go.googlecode.com/hg #
MessagesTotal messages: 14
|