-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflow_test.yaml
58 lines (56 loc) · 3.17 KB
/
flow_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#Global configuration (required)
global:
local_ip: 0.0.0.0 #Local IP, used for: not affecting the normal operation of the framework, used to obtain the local IP from the framework configuration.
coroutine: #Coroutine configuration.
enable: false #false: means not using coroutine; true: means using coroutine.
threadmodel:
default:
# Separate model
- instance_name: default_instance
io_handle_type: separate
io_thread_num: 4 #Number of network I/O threads.
handle_thread_num: 4 #Number of business processing handle threads.
#Server configuration
server:
app: test #Business name, such as: COS, CDB.
server: helloworld #Module name of the business
admin_port: 21111 # Admin port
admin_ip: 0.0.0.0 # Admin ip
service: #Business service, can have multiple.
- name: trpc.test.helloworld.Greeter #Service name, needs to be filled in according to the format, the first field is default to trpc, the second and third fields are the app and server configurations above, and the fourth field is the user-defined service_name.
protocol: trpc #Service application layer protocol, for example: trpc, http.
network: tcp #Network listening type: for example: TCP, UDP.
ip: 0.0.0.0 #Listen ip
port: 10001 ##Listen port
accept_thread_num: 1 #Number of threads for binding ports.
filter:
- flow_control
#Plugin configuration.
plugins:
log: #Log configuration
default:
- name: default
min_level: 2 # 0-trace, 1-debug, 2-info, 3-warn, 4-error, 5-critical
format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v" # Output of all sinks in the log instance.
mode: 2 # 1-sync, 2-async, 3-fast
sinks:
local_file: # Local log file
filename: trpc.log # The name of log file
overload_control:
flow_control:
- service_name: trpc.test.helloworld.Greeter #service name.
is_report: true # Whether to report monitoring data.
service_limiter: default(100000) #Service-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.
func_limiter: #Interface-level flow control.
- name: SayHello ##Method name
limiter: seconds(100000) #Interface-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.
- name: Route #Method name
limiter: smooth(100000) #Interface-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.
- service_name: trpc.test.flow.Greeter #service name.
is_report: true # Whether to report monitoring data.
service_limiter: smooth(20000) #Service-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.
func_limiter: #Interface-level flow control.
- name: SayHello1 ##Method name
limiter: default(100000) #Interface-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.
- name: Route1 #Method name
limiter: smooth(10000) #Interface-level flow control limiter, standard format: name (maximum limit per second), empty for no limit.