William Chan (陈智昌)
unread,Sep 30, 2014, 6:44:51 PM9/30/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Yuzhu Shen, Ryan Sleevi, net-dev, mojo...@chromium.org, Alok Priyadarshi, mik...@chromium.org, Paul Jensen, Thomas Tuttle, David Benjamin
Thanks for clarifying, and that totally makes sense to me. But I'll
point out that unless you have someone trying to write something as
high throughput as HAProxy or Varnish, you won't be able to fully tell
how the performance works. You should be very careful about system
calls and buffer copies. Here's a useful link to check out:
http://www.haproxy.org/#perf. Here are some choice quotes:
* "Single-buffering without any data copy between reads and writes
whenever possible. This saves a lot of CPU cycles and useful memory
bandwidth. Often, the bottleneck will be the I/O busses between the
CPU and the network interfaces. At 10-100 Gbps, the memory bandwidth
can become a bottleneck too."
* "Zero-copy forwarding is possible using the splice() system call
under Linux, and results in real zero-copy starting with Linux 3.5.
This allows a small sub-3 Watt device such as a Seagate Dockstar to
forward HTTP traffic at one gigabit/s."
And then you should check out the graphs at
http://www.haproxy.org/10g.html and
http://www.haproxy.org/10g-20080419.html. TL;DR: Buffer sizing and
avoiding buffer copies is very important.
I'd quote stuff from the Google frontend team, but that's confidential
so I can't share that information. But the overall message is the
same: avoid buffer copies.
And it's not just highly scalable servers that care about this. Mobile
apps will want to have this level of control over memory use. This is
why a BYOB API is critical. Then you can use a slab allocator and
backpressure signals to tweak memory consumption accordingly. But this
is something I imagine a mobile app author can tell you.