Coder Social home page Coder Social logo

seastar_example's Introduction

seastar_example

1. Please clone seastar from : seastar

2. build seastar:

My OS is redhat.

1. Use docker :

Please see details : https://github.com/scylladb/seastar/blob/master/doc/building-docker.md

2. Not use docker:

You may should install some libs as follws:
boost (>= 1.63)
libaio-devel
hwloc-devel
numactl-devel
libpciaccess-devel
cryptopp-devel
libxml2-devel
xfsprogs-devel
gnutls-devel
lksctp-tools-devel
lz4-devel
protobuf-devel
protobuf-compiler
libunwind-devel
systemtap-sdt-devel
libtool
cmake
ninja-build
ragel
binutils
python34

start build:

1) git clone https://github.com/scylladb/seastar.git

2) cd seastar

3) git submodule update --init --recursive

4) sudo ./install-dependencies.sh

5)
./configure.py --compiler=g++  --enable-dpdk  --mode=release
or
./configure.py --compiler=g++  --enable-dpdk  --mode=debug

6) ninja -j10

7) build server:
g++ -std=c++11  -I /home/me/workspace/seastar -L /usr/local/lib64/boost/  `pkg-config --cflags --libs /home/me/workspace/seastar/build/release/seastar.pc` -o server server.cc

8) build client:
g++ -std=c++11  -I /home/me/workspace/seastar -L /usr/local/lib64/boost/  `pkg-config --cflags --libs /home/me/workspace/seastar/build/release/seastar.pc` -o client client.cc

3.run server

Use posix satck:
./server --port=13001 --smp=1 --cpuset=5

Use native stack and dpdk:
[dhcp ip]
./server --port=13001 --smp=1 --cpuset=5 --dpdk-pmd --network-stack=native
[static ip]
./server --port=13001 --smp=1 --cpuset=5 --dpdk-pmd --network-stack=native --dhcp=0 --host-ipv4-addr=11.139.181.166 --gw-ipv4-addr=11.139.181.183 --netmask-ipv4-addr=255.255.255.192

4.run client

./client --smp=1 --cpuset=5 --server=your_ip:13001 --conn=1 --reqs=999999999

seastar_example's People

Contributors

shanshanpt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

seastar_example's Issues

run server with dpdk failed

I successfully built server and client.
When I run server with posix satck, it running successful:

# ./server --port=13001 --smp=1 --cpuset=5
WARN  2019-07-01 20:48:02,704 [shard 0] seastar - Unable to set SCHED_FIFO scheduling policy for timer thread; latency impact possible. Try adding CAP_SYS_NICE
TCP Echo-Server listen on: 13001
current 0 total 0 qps 0
current 0 total 0 qps 0
current 0 total 0 qps 0
current 0 total 0 qps 0
current 0 total 0 qps 0
current 0 total 0 qps 0
current 0 total 0 qps 0
...
... // waiting for worker
...
current 1 total 1 qps 65054
current 1 total 1 qps 130049
current 1 total 1 qps 135699
current 1 total 1 qps 126766
current 1 total 1 qps 132650
current 1 total 1 qps 127944
current 1 total 1 qps 135250

When I run server with dpdk, it show me the error :

# ./server --port=13001 --smp=1 --cpuset=5 --dpdk-pmd --network-stack=native
EAL: Detected 56 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No available hugepages reported in hugepages-2048kB
EAL: FATAL: Cannot get hugepage information.
EAL: Cannot get hugepage information.
EAL: Error - exiting with code: 1
  Cause: Cannot init EAL

Could you give us any help?

build server error

hello, I build seastar follow the doc https://github.com/scylladb/seastar/blob/master/doc/building-docker.md in your README.md

[root@37a6581048b1 seastar]# ./configure.py
...
-- Performing Test result
-- Performing Test result - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /seastar/build/sanitize

[root@37a6581048b1 seastar]# ninja -C build/release
ninja: Entering directory `build/release'
[76/217] Building CXX object tests/unit/CMakeFiles/test_unit_thread.dir/thread_test.cc.o
../../tests/unit/thread_test.cc: In lambda function:
../../tests/unit/thread_test.cc:115:44: warning: ‘thread_scheduling_group’ is deprecated: Use seastar::scheduling_group instead [-Wdeprecated-declarations]
         thread_scheduling_group sched_group(1ms, metered_ratio);
                                            ^
In file included from ../../tests/unit/thread_test.cc:23:
../../include/seastar/core/thread.hh:242:63: note: declared here
 class [[deprecated("Use seastar::scheduling_group instead")]] thread_scheduling_group {
                                                               ^~~~~~~~~~~~~~~~~~~~~~~
[217/217] Linking CXX executable apps/memcached/tests/app_memcached_test_ascii

but when I build server, error occurred!

[root@37a6581048b1 seastar]# g++ -std=c++11 `pkg-config --cflags --libs build/release/seastar.pc` -o server server.cc
server.cc:7:10: fatal error: core/app-template.hh: No such file or directory
 #include "core/app-template.hh"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

So I checked the output of pkg-config, but can't find any problems.

[root@37a6581048b1 seastar]# pkg-config --cflags --libs build/release/seastar.pc
-I/seastar/include -I/seastar/build/release/gen/include -std=gnu++17 -U_FORTIFY_SOURCE -Wno-maybe-uninitialized -fconcepts -DSEASTAR_HAVE_GCC6_CONCEPTS -DFMT_SHARED -I/usr/include/p11-kit-1 /seastar/build/release/libseastar.a /usr/lib64/libboost_program_options.so /usr/lib64/libboost_system.so /usr/lib64/libboost_thread.so /usr/lib64/libcares.so /usr/lib64/libcryptopp.so /usr/lib64/libfmt.so.5.2.1 -llz4

If I add path of boost lib and seastar manually, still show error as follow:

[root@37a6581048b1 seastar]# g++ -std=c++11 -I /seastar/include/seastar/ -L /usr/include/boost/ `pkg-config --cflags --libs build/release/seastar.pc` -o server server.cc
server.cc: In lambda function:
server.cc:141:22: error: ‘cout’ is not a member of ‘std’
                 std::cout << "current " << stats._curr_connections << " total " << stats._total_connections << " qps " << stats._echo - _last << "\n";
                      ^~~~
server.cc:141:22: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
server.cc:21:1:
+#include <iostream>
 #include <unistd.h>
server.cc:141:22:
                 std::cout << "current " << stats._curr_connections << " total " << stats._total_connections << " qps " << stats._echo - _last << "\n";
                      ^~~~
server.cc: In lambda function:
server.cc:173:18: error: ‘cout’ is not a member of ‘std’
             std::cout << "TCP Echo-Server listen on: " << port << "\n";
                  ^~~~
server.cc:173:18: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?

do_launch_request is not used in client.cc

future<> do_launch_request() {
    net::fragment frag { const_cast<char*>(str_txbuf.c_str()), buf_size };
    net::packet pack(frag, deleter());
    return _out.write(std::move(pack)).then([this] {
        return _out.flush();
    }).then([this] {
        return _in.read_exactly(buf_size).then([this] (auto&& data) {
            _nr_done++;
            if (_echo_client.done(_nr_done)) {
                return make_ready_future<>();
            }
            return this->do_launch_request();
        });
    });
}

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.