Pelikan

Pelikan是Twitter的统一缓存后端。(Pelikan is Twitter's unified cache backend. )

Github星跟蹤圖

Pelikan是一个用C编写的缓存框架。它提供了一个扩展的缓存服务集合,以及一个用于构建它们的通用库。\r\n

在多年使用和处理各种缓存服务之后,Twitter 构建了一个通用框架,揭示了它们之间固有的架构相似之处。

通过创建明确定义的模块,大多数低级功能在创建不同的二进制文件时被重用。该实现从Twitter的业务经验中学习,以提高性能和可靠性,并引导设计用于大规模部署的软件。

框架方法使Twitter能够快速开发新的功能和协议。

产品

目前Pelikan产生三个主要产品,所有这些产品都是后端/服务器。

    \r\n\t
  • pelikan_twemcache:一个Twemcache替换
  • \r\n\t
  • pelikan_slimcache:具有超低内存开销的Memcached服务器与Memcached /Redis相比,每键开销降低了90%
  • \r\n\t
  • pelikan_pingserver:一个过度设计的,生产就绪的ping服务器,用作教程和测量基准RPC性能
  • \r\n
特性\r\n
    \r\n\t
  • 运行时分离控制和数据平面
  • \r\n\t
  • 通过无锁数据结构可预测的低延迟,员工从不阻止
  • \r\n\t
  • 每个模块配置选项和可以轻松组合的指标
  • \r\n\t
  • 多个存储和协议实现,容易进一步扩展
  • \r\n\t
  • 低开销命令记录器,用于热键等重要数据分析

概覽

名稱與所有者twitter/pelikan
主編程語言C
編程語言CMake (語言數: 6)
平台
許可證Apache License 2.0
發布數3
最新版本名稱0.1.2 (發布於 )
第一版名稱0.1.0 (發布於 )
創建於2015-09-20 20:51:55
推送於2023-10-11 12:10:54
最后一次提交2022-10-27 10:13:29
星數1.9k
關注者數50
派生數173
提交數786
已啟用問題?
問題數111
打開的問題數41
拉請求數329
打開的拉請求數17
關閉的拉請求數35
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Pelikan is Twitter's unified cache server.

Content

Build Status

Overview

After years of using and working on various cache services, we built a common
framework that reveals the inherent architectural similarity among them.

By creating well-defined modules, most of the low-level functionalities are
reused as we create different binaries. The implementation learns from our
operational experiences to improve performance and reliability, and leads to
software designed for large-scale deployment.

The framework approach allows us to develop new features and protocols quickly.

Products

Currently Pelikan yields three main products, all of which are backends/servers.

  • pelikan_twemcache: a Twemcache replacement
  • pelikan_slimcache: a Memcached-like server with ultra-low memory overhead-
    compared to Memcached/Redis, the per-key overhead is reduced by up to 90%
  • pelikan_pingserver: an over-engineered, production-ready ping server useful
    as a tutorial and for measuring baseline RPC performance

Features

  • runtime separation of control and data plane
  • predictably low latencies via lockless data structures, worker never blocks
  • per-module config options and metrics that can be composed easily
  • multiple storage and protocol implementations, easy to further extend
  • low-overhead command logger for hotkey and other important data analysis

Building Pelikan

Requirement

  • platform: Mac OS X or Linux
  • build tools: cmake (>=2.8)
  • compiler: gcc (>=4.8) or clang (>=3.1)
  • (optional) unit testing framework: check (>=0.10.0). See below.

Build

git clone https://github.com/twitter/pelikan.git
mkdir _build && cd _build
cmake ..
make -j

The executables can be found under _bin/ (under build directory)

To run all the tests, including those on ccommon, run:

make test

To skip building tests, replace the cmake step with the following:

cmake -DCHECK_WORKING=off ..

Install check

To compile and run tests, you will have to install check.
Please follow instructions in the project.

Note: we highly recommend installing the latest version of check from
source, as there are, unfortunately, a linker bug
in packages installed by the current versions of brew (OS X),
CentOS and Ubuntu LTS. The bug does not affect building executables.

Usage

Using pelikan_twemcache as an example, other executables are highly similar.

To get info of the service, including usage format and options, run:

_bin/pelikan_twemcache -h

To launch the service with default settings, simply run:

_bin/pelikan_twemcache

To launch the service with the sample config file, run:

_bin/pelikan_twemcache config/twemcache.conf

You should be able to try out the server using an existing memcached client,
or simply with telnet.

$ telnet localhost 12321
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
set foo 0 0 3
bar
STORED

Attention: use admin port for all non-data commands.

$ telnet localhost 9999
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
version
VERSION 0.1.0
stats
STAT pid 54937
STAT time 1459634909
STAT uptime 22
STAT version 100
STAT ru_stime 0.019172
...

Configuration

Pelikan is file-first when it comes to configurations, and currently is
config-file only. You can create a new config file following the examples
included under the config directory.

Tip: to get a list of config options for each executable, use -c option:

_bin/pelikan_twemcache -c

Community

Stay in touch

Contributing

Please take a look at our community manifesto
and coding style guide.

To get a sense of where things are going next, please visit our
Roadmap wiki.

If you want to submit a patch, please follow these steps:

  1. create a new issue
  2. fork on github & clone your fork
  3. create a feature branch on your fork
  4. push your feature branch
  5. create a pull request linked to the issue

Documentation

We have made progress and are actively working on documentation, and will put it
on our website. Meanwhile, check out the current material under docs/

We also maintain a list of topics
for upcoming blog posts. Please let us know what
(else) interests you.

License

This software is licensed under the Apache 2.0 license, see LICENSE for details.

去到頂部