proxyd有一个接受endpoint,并会监听一个内部地址和一个外部地址
内部地址用于连接本机的serverd,外部地址用于和其他集群的proxyd通信
proxyd对内部serverd发送消息采用zmq router节点,对每个外部proxyd都会建立一个zmq dealer节点与之通信
| #include <cstdio> | |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <stdint.h> | |
| #include <cstring> | |
| #include <string> | |
| #include <sstream> | |
| #include <map> | |
| #include <vector> | |
| #include <assert.h> |
| #!/bin/sh | |
| WORKING_DIR="$PWD"; | |
| ARCH_FLAG=$(getconf LONG_BIT); | |
| PHP_CONF_FILE_PATH=/etc/php.ini | |
| PHP_CONF_DIR_PATH=/etc/php.d | |
| PHP_FPM_CONF_FILE_PATH=/etc/php-fpm.d/www.conf | |
| PHP_CACHE_DIR_PATH=/tmp/php/cache | |
| PHP_EXT_LOG_DIR_PATH=/var/log/php |
用于同步Atom编辑器的个人偏好配置
| #!/bin/bash | |
| # we assume boost (1.64 and upper) is installed in $BOOST_PREBUILT | |
| BOOST_LIB_DIR=$BOOST_PREBUILT/lib; | |
| g++ context_cc_text.cpp -O2 -g -ggdb -I$BOOST_PREBUILT/include -L$BOOST_LIB_DIR \ | |
| -lboost_context -lboost_system -lboost_thread -lboost_chrono \ | |
| -std=c++11 -o context_cc_text |
| # g++ test4.cpp -g -ggdb -O0 -o test4 && ./test4 | |
| # gcc version: 5.4.0 (Ubuntu 16.04 LTS) | |
| word size = 8 | |
| sizeof vptr = 16 | |
| info:15 | |
| info:31 | |
| info:44 | |
| info:44 | |
| print:35 |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "strconv" | |
| "time" | |
| ) | |
| func runCallback(in, out chan int64) { |
| /** | |
| * traceback for cpp | |
| * | |
| * Created on: 2018-01-27 | |
| * Author: owent | |
| * | |
| * Released under the MIT license | |
| * | |
| * @note Required flag -rdynamic or addr2line to get the function name when using gcc/clang in unix like system | |
| * @note Using addr2line -Cfpe <exe_path> [func_addr...] for more detail when using gcc/clang |
编译脚本:
g++ *.cpp -o test.exe -O0 -g -ggdb -std=c++11 -Wall \
/mnt/d/workspace/prebuilt/wsl/libuv/lib/libuv.a \
-I/mnt/d/workspace/prebuilt/wsl/libuv/include \
-I/mnt/d/workspace/prebuilt/wsl/libwebsockets/include \
-L/lib/x86_64-linux-gnu \
-L/mnt/d/workspace/prebuilt/wsl/libuv/lib \
-L/mnt/d/workspace/prebuilt/wsl/libwebsockets/lib \2019-09-29 更新一版运行结果,增加 C++20 Coroutine 测试结果
| 组件(Avg) | 协程数:1 切换开销 | 协程数:1000 创建开销 | 协程数:1000 切换开销 | 协程数:30000 创建开销 | 协程数:30000 切换开销 |
|---|---|---|---|---|---|
| 栈大小(如果可指定) | 16 KB | 2 MB | 2 MB | 64 KB | 64 KB |
| C++20 Coroutine - Clang | 5 ns | 130 ns | 6 ns | 136 ns | 9 ns |
| C++20 Coroutine - MSVC | 10 ns | 407 ns | 14 ns | 369 ns | 28 ns |
| [libcopp][1] | 77 ns | 4.1 us | 105 ns | 3.8 us | 273 ns |