Intel® Ethernet 800 Series Application Device Queues (ADQ)

Software Developer's Guide

ID Date Version Classification
626536 04/03/2023 Public
Document Table of Contents

Default Design

By default, Memcached server has the following design:

  • It has one listener thread.
  • It includes N number of event worker threads that process sockets, for both read and write operations.
  • Each worker thread is assigned connections and runs its own epoll loop.
  • Memcached distributes connections to application threads using a round-robin based technique.

Following is the pseudo code for the default design:

Listener/main thread:

while(1) { child socket = Accept socket select application thread dispatch connection to thread select application worker thread enqueue connection to per thread connection queue }

'N' worker thread, which uses libevent for event management:

Initialize event object per thread Create new connection queue Create 'N' worker thread Each worker thread runs event loop (worker_libevent) Event_base_loop() /* Process sockets from connection queue */