Date post: | 10-May-2015 |
Category: |
Documents |
Upload: | dae-myung-kang |
View: | 4,646 times |
Download: | 0 times |
Twemproxy Flow [email protected]
Twemproxy • Server Side Proxy For Memcache, Redis
• Made by Twitter.
• Github.com/twitter/twemproxy
Recv Loop(common)
core_loop
core_core
core_recv
msg_recv
Recv Loop(client-server)
Send Loop(common)
core_loop
core_core
core_send
msg_send
Send Loop(client-server)
Message • Using Memory Pool
• Using mbuf
Message-req_get
req_get
msg_get
rsp_get
_msg_get
Processing ……
req_put rsp_put
mbuf • Using chained buffer
• Using sendv, writev
mbuf
struct iovec array[]
Mbuf->pos array[0].iov_base
array[0].iov_len mlen
Mbuf->pos array[n].iov_base
array[n].iov_len mlen
mbuf
Why is Twemproxy Fast? • Using mbuf and avoiding buffer copy.
– Just forward packet.
Thank you