基于dpdk的高性能服务器,shuke: 基于DPDK开发的高性能DNS授权服务器, 万兆网卡QPS可以达到千万以上, 支持将zone data存放到mongodb. 性能 测试环境 NIC:  In...

SHUKE

shuke.svg?branch=master

A high performance authority-only dns server implemented with DPDK

Features

support storing zone data in mongodb

high performance

performance

test environment

NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection

CPU: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz

Memory: 64GB

OS: Ubuntu 16.04.1 LTS

Kernel: 4.4.0-81-generic

result

one 10G port

f756e323eea368214d0f8f6b74623dc6.png

pls note when test with 5 cores, shuke actually processed 12.43M and 11.39M requests per second,

but the client reports 10.7M and 9.46M, this is because the NIC doesn't have enough bandwidth.

two 10G port

16fca628e0b8d457787168567fb20c7c.png

Quick start

vagrant

if you use vagrant, it is very simple to try shuke

install virtualbox and vagrant

run cd vagrant && vagrant up

ssh to the guest machine, then run the following command:

cd /shuke

sudo build/shuke-server -c vagrant/test.toml

in the host machine, run dig www1.example.com. @172.28.128.10 -p 19899 -t A

tips: vagrant/setup.sh is a good place to figure out how to build this project

and prepare the running environment.

buid

clone source code: git clone --recursive https://github.com/yuyang0/shuke.git

build dpdk, shuke is only tested on dpdk-17.05.2. if you use linux x86-64,

you can run bash 3rd/dpdk/usertools/dpdk-setup.sh,

then perform the following instructions.

press [12] to compile dpdk for linux x86-64 target.

press [15] to insert UIO

press [17] to insert KNI

press [19]([18] for non-NUMA systems) to setup huge pages,

since shuke uses huge page heavily, so allocate as large as possible

press [21] to bind NIC device

press [32] to quit

install autoconf and libtool

run make at the top of source tree, then you will get a binary file named build/shuke-server.

tips

if you use ubuntu, you can just run bash ./bootstrap.sh to build shuke

if you want to build shuke in DEBUG mode, just run make DEBUG=1

if you want to see the compiler command, just run make V=1

if you want to support ip fragmentation, just run make IP_FRAG=1.

run

just run build/shuke-server -c conf/shuke.toml,

you may need to change the config in the config file.

mongo data schema

every zone should have a collection in mongodb. you can use

tools/zone2mongo.py to convert zone data from zone file to mongodb

zone collection

this collection used to track the RR of a zone,

the collection name is the domain of the zone, since mongodb's

collection name can't end with dot, so the domain should be the

absolute domain name except the last dot.

the collection should contain the following fields

{

name: "the absulute owner name,

ttl: 1234567,

type: "DNS type",

rdata: "rdata"

}

the meaning of fields is clear. just like the zone file.

Admin Commands

SHUKE has a tcp server used to execute admin operations,

tools/admin.py is the client. it supports several commands:

zone: this command used to manipulate the zone data in memory, it has many subcommands.

get: get a zone

getall: get all zones

reload: reload multiple zone

reloadall: reload all zone

get_numzones: return the number of zones in memory cache.

config: this command is used to manipulate the config of server.

version: return version of shuke

debug: mainly for debug

segfault: cause a segement fault

oom: trigger a OOM error.

info: print information of server, including statistics. subcommands

all or default or empty: return all information

server: return the server information

memory: return memory usage information

cpu: return cpu usage information

stats: statistics information

TODO

support EDNS, DNSSEC and PTR (currently only support A,AAAA,NS,CNAME,SOA,SRV,TXT,MX.).

support mysql (currently only support mongodb).

plugin system

some anti-attack mechanisms such as white list, black list, response rate limit(RRL), etc.

HTTP api

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值