SlideShare a Scribd company logo
Twemproxy Flow
   charsyam@naver.com
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                   rsp_get

               msg_get
                             _msg_get
             Processing ……

   req_put                   rsp_put
mbuf
• Using chained buffer
• Using sendv, writev
mbuf
struct iovec array[]

       array[0].iov_base   Mbuf->pos
       array[0].iov_len      mlen


       array[n].iov_base   Mbuf->pos
       array[n].iov_len      mlen
mbuf
Why is Twemproxy Fast?
• Using mbuf and avoiding buffer copy.
   – Just forward packet.
Thank you

More Related Content

PDF
SFScon19 - Davide Montesin - Why you should consider using btrfs
PPTX
Java NIO Buffer basics
PPT
Apache Basics
PDF
MongoDb scalability and high availability with Replica-Set
PPTX
Strategies for Backing Up MongoDB
PPTX
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
ODP
Osrf msg life_cycle
PDF
はじめてのGlusterFS
SFScon19 - Davide Montesin - Why you should consider using btrfs
Java NIO Buffer basics
Apache Basics
MongoDb scalability and high availability with Replica-Set
Strategies for Backing Up MongoDB
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Osrf msg life_cycle
はじめてのGlusterFS

Similar to Twemproxy flow (20)

PDF
JRuby 9000 - Taipei Ruby User's Group 2015
PDF
Server-Side JavaScript Developement - Node.JS Quick Tour
PDF
Life in a Queue - Using Message Queue with django
PDF
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
PPTX
Take Kafka-on-Pulsar to Production at Internet Scale: Improvements Made for P...
PDF
Swift design session - public object storage scalability
PPTX
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
KEY
CvmFS Workshop
PDF
PostgreSQL Query Cache - "pqc"
PDF
Ceph Day Beijing: CeTune: A Framework of Profile and Tune Ceph Performance
PPTX
Memcached B box presentation
PDF
Tunning mobicent-jean deruelle
PDF
My internship presentation at WSO2
PDF
淺談Ruby process fork應用
PDF
Benchmarking, Load Testing, and Preventing Terrible Disasters
PDF
Exploring the replication in MongoDB
PDF
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
PDF
Lessons Learnt in 2009
PDF
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
JRuby 9000 - Taipei Ruby User's Group 2015
Server-Side JavaScript Developement - Node.JS Quick Tour
Life in a Queue - Using Message Queue with django
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Take Kafka-on-Pulsar to Production at Internet Scale: Improvements Made for P...
Swift design session - public object storage scalability
Slash n: Tech Talk Track 2 – Website Architecture-Mistakes & Learnings - Sidd...
CvmFS Workshop
PostgreSQL Query Cache - "pqc"
Ceph Day Beijing: CeTune: A Framework of Profile and Tune Ceph Performance
Memcached B box presentation
Tunning mobicent-jean deruelle
My internship presentation at WSO2
淺談Ruby process fork應用
Benchmarking, Load Testing, and Preventing Terrible Disasters
Exploring the replication in MongoDB
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Lessons Learnt in 2009
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
Ad

More from DaeMyung Kang (20)

PPTX
Count min sketch
PDF
PDF
Ansible
PDF
Why GUID is needed
PDF
How to use redis well
PPTX
The easiest consistent hashing
PDF
How to name a cache key
PDF
Integration between Filebeat and logstash
PDF
How to build massive service for advance
PDF
Massive service basic
PDF
Data Engineering 101
PDF
How To Become Better Engineer
PPTX
Kafka timestamp offset_final
PPTX
Kafka timestamp offset
PPTX
Data pipeline and data lake
PDF
Redis acl
PDF
Coffee store
PDF
Scalable webservice
PDF
Number system
PDF
webservice scaling for newbie
Count min sketch
Ansible
Why GUID is needed
How to use redis well
The easiest consistent hashing
How to name a cache key
Integration between Filebeat and logstash
How to build massive service for advance
Massive service basic
Data Engineering 101
How To Become Better Engineer
Kafka timestamp offset_final
Kafka timestamp offset
Data pipeline and data lake
Redis acl
Coffee store
Scalable webservice
Number system
webservice scaling for newbie
Ad

Twemproxy flow