Giter Site home page Giter Site logo

zhenggangpku / containerdns-c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from icymoon/containerdns-c

0.0 1.0 0.0 14.94 MB

A high-performance DNS Server based on DPDK

License: MIT License

Makefile 2.32% C 94.28% Python 0.58% C++ 2.06% Objective-C 0.31% Shell 0.34% Batchfile 0.01% Go 0.08%

containerdns-c's Introduction

Chinese

ContainerDNS-C

Introduction

ContainerDNS-C is a high-performance DNS Server based on DPDK. Do not rely on the database, the user updates the data through the RESTful API.

How to use

1. Compilation

Required OS release: Centos-7.2 or Centos-7.4. Make all for the first time, after that make kdns if you just change the DNS code.

tar -xf kdns.tar.gz
cd kdns
make all

2. Startup

The default configuration path for ContainerDNS-C is /etc/kdns/kdns.cfg. An example for kdns.cfg as follows :

EAL configuration reference DPDK document.

[EAL]
cores = 1,3,5,7
memory = 1024,1024
mem-channels = 4
 
[NETDEV]
name-prefix = kdns
mode = rss
mbuf-num = 50000
kni-mbuf-num = 10000
rxqueue-len = 1024
txqueue-len = 2048
    
rxqueue-num = 4
txqueue-num = 5

kni-ipv4 = 2.2.2.240
kni-vip = 10.17.9.100

[COMMON]

log-file = /export/log/kdns/kdns.log
fwd-def-addrs = 114.114.114.114:53,8.8.8.8:53
fwd-thread-num = 4
web-port = 5500
ssl-enable = no
cert-pem-file = /etc/kdns/server1.pem
key-pem-file = /etc/kdns/server1-key.pem
zones = tst.local,example.com

Reserve huge pages memory:

mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
echo 4096 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

Load igb_uio module:

modprobe uio
insmod ./bin/igb_uio.ko
./bin/dpdk-devbind.py --bind=igb_uio kdns

Load rte_kni module:

insmod ./bin/rte_kni.ko

Start kdns:

./bin/kdns 

API

1. Add domain datas

curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d '{"type":"A","zoneName":"example.com","domainName":"chen.example.com","host":"192.168.2.2"}'  'http://127.0.0.1:5500/kdns/domain' 

curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d '{"type":"CNAME","zoneName":"example.com","domainName":"chen.cname.example.com","host":"chen.example.com"}' 'http://127.0.0.1:5500/kdns/domain' 

curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d '{"type":"SRV","zoneName":"example.com","domainName":"_srvtcp._tcp.example.com","host":"chen.example.com","priority":20,"weight":50,"port":8800}'  'http://127.0.0.1:5500/kdns/domain'

2. query domain datas

curl -H "Content-Type:application/json;charset=UTF-8" -X GET   'http://127.0.0.1:5500/kdns/perdomain/chen.example.com' 
curl -H "Content-Type:application/json;charset=UTF-8" -X GET   'http://127.0.0.1:5500/kdns/domain' 

3. statistics api

curl -H "Content-Type:application/json;charset=UTF-8" -X GET   'http://127.0.0.1:5500/kdns/statistics/get'

Performance

CPU model: Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz

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

Jmeter version: apache-jmeter-3.1

Test sample: single domain --- kubernetes.default.svc.skydns.local(10.0.0.1) 50,000 domains --- random domain name with suffix skydns.local. Among them, 30,000 with one IP, 10,000 with two IPs, and 10,000 with 3-10 IPs (random).

performance data:

performance

containerdns-c's People

Contributors

chenshugang avatar icymoon avatar jsonkey avatar yangwanli2017 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.