1. ssl增加no_verify_cert开关,可以关闭证书校验;

2. ssl_utils.cc改名为ssl_utils.cpp;
3. 暂时使用tcmalloc接管内存分配;
4. 原work thread选择算法存在bug,暂时改为轮询;
5. FieldStat状态输出暂时改为Field格式,便于观察实时性能,Future的状态输出暂时改为累计值;
This commit is contained in:
zhengchao
2019-01-14 18:23:46 +06:00
parent f5c153c59e
commit f21d51de3d
8 changed files with 53 additions and 26 deletions

View File

@@ -75,7 +75,9 @@ struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx)
{
unsigned int min_thread_id = 0;
unsigned int min_load = 0;
static unsigned int counter=0;
counter++;
/*
for (unsigned int tid = 0; tid < ctx->nr_work_threads; tid++)
{
struct tfe_thread_ctx * thread_ctx = ctx->work_threads[tid];
@@ -84,7 +86,8 @@ struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx)
min_thread_id = min_load > thread_load ? tid : min_thread_id;
min_load = min_load > thread_load ? thread_load : min_load;
}
*/
min_thread_id=counter%ctx->nr_work_threads;
ATOMIC_INC(&ctx->work_threads[min_thread_id]->load);
return ctx->work_threads[min_thread_id];
}
@@ -276,19 +279,19 @@ int tfe_proxy_config(struct tfe_proxy * proxy, const char * profile)
static const char * __str_stat_spec_map[] =
{
[STAT_SIGPIPE] = "SIGPIPE",
[STAT_FD_OPEN_BY_KNI_ACCEPT] = "FdRcv",
[STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL] = "FdRcvFail",
[STAT_FD_INSTANT_CLOSE] = "FdClsInstant",
[STAT_FD_DEFER_CLOSE_IN_QUEUE] = "FdClsDefInQ",
[STAT_FD_DEFER_CLOSE_SUCCESS] = "FdClsDefSuc",
[STAT_STREAM_OPEN] = "StrOpen",
[STAT_STREAM_CLS] = "StrCls",
[STAT_STREAM_CLS_DOWN_EOF] = "StrDownEOF",
[STAT_STREAM_CLS_UP_EOF] = "StrUpEOF",
[STAT_STREAM_CLS_DOWN_ERR] = "StrDownErr",
[STAT_STREAM_CLS_UP_ERR] = "StrUpErr",
[STAT_STREAM_CLS_KILL] = "StrKill",
[STAT_STREAM_TCP_PLAIN] = "Plain",
[STAT_FD_OPEN_BY_KNI_ACCEPT] = "fd_rx",
[STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL] = "fd_rx_err",
[STAT_FD_INSTANT_CLOSE] = "fd_inst_cls",
[STAT_FD_DEFER_CLOSE_IN_QUEUE] = "fd_dfr_cls",
[STAT_FD_DEFER_CLOSE_SUCCESS] = "fd_dfr_clsd",
[STAT_STREAM_OPEN] = "stm_open",
[STAT_STREAM_CLS] = "stm_cls",
[STAT_STREAM_CLS_DOWN_EOF] = "dstm_eof",
[STAT_STREAM_CLS_UP_EOF] = "ustm_eof",
[STAT_STREAM_CLS_DOWN_ERR] = "dstm_err",
[STAT_STREAM_CLS_UP_ERR] = "ustm_err",
[STAT_STREAM_CLS_KILL] = "stm_kill",
[STAT_STREAM_TCP_PLAIN] = "plain",
[STAT_STREAM_TCP_SSL] = "SSL",
[TFE_STAT_MAX] = NULL
};