Skip to content

Commit

Permalink
Update about-config.md
Browse files Browse the repository at this point in the history
  • Loading branch information
holmes1412 authored Sep 22, 2020
1 parent 819e018 commit 9b86c03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/about-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ static constexpr struct WFGlobalSettings GLOBAL_SETTINGS_DEFAULT =
.compute_threads = -1,
};
~~~

其中EndpointParams结构体和默认值在[EndpointParams.h](../src/manager/EndpointParams.h)文件里:

~~~cpp

struct EndpointParams
Expand All @@ -50,7 +52,9 @@ static constexpr struct EndpointParams ENDPOINT_PARAMS_DEFAULT =
.ssl_connect_timeout = 10 * 1000,
};
~~~

举个例子,把默认的连接超时改为5秒,dns默认ttl改为1小时,用于消息反序列化的poller线程增加到10个:

~~~cpp
#include "workflow/WFGlobal.h"

Expand All @@ -65,11 +69,12 @@ int main()

...
}

~~~

大多数参数的意义都比较清晰。注意dns ttl相关参数,单位是****。endpoint相关超时参数单位是**毫秒**,并且可以用-1表示无限。
dns_threads表示并行访问dns的线程数。目前我们dns是通过系统函数getaddrinfo访问的。如果对dns并发性能有需求,可增加这个值。
compute_threads表示用于计算的线程数,默认-1代表与当前节点CPU核数相同。

与网络性能相关的两个参数为poller_threads和handler_threads:
* poller线程主要负责epoll(kqueue)和消息反序列化。
* handler线程是网络任务callback和process所在线程。
Expand Down

0 comments on commit 9b86c03

Please sign in to comment.