-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.toml
More file actions
49 lines (40 loc) · 1.33 KB
/
config.toml
File metadata and controls
49 lines (40 loc) · 1.33 KB
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
# 服务器配置
[server]
host = "0.0.0.0"
port = 10831
# WebSocket配置
[websocket]
master_url = "http://127.0.0.1:8080" # 主服务器地址
admin_key = "123456" # 管理员密钥
message_cache_size = 512 # 消息缓存大小
max_sessions_per_user = 10 # 每个用户最大会话数
# 连接限流配置
api_key_conn_limit_per_minute = 10 # 每个API Key每分钟最大连接数
global_conn_limit_per_minute = 120 # 全局每分钟最大连接数
# 带宽控制配置
default_bandwidth_limit_kb = 10000 # 默认10Mbps
emergency_queue_ratio = 0.7 # 紧急队列占70%带宽
normal_queue_ratio = 0.25 # 普通队列占25%带宽
slow_queue_ratio = 0.05 # 慢速队列占5%带宽
# 频率统计配置
frequency_check_interval_ms = 100 # 每100ms检查一次消息频率
# 消息频率处理配置
[websocket.frequency]
# 负载阈值配置(每秒实际消息数)
direct_mode_threshold = 100 # 极低负载直接发送
micro_batch_threshold = 500 # 中等负载微批处理
# 高负载(>500):使用批量处理
# 直接发送模式配置(即时发送)
[websocket.direct]
max_delay_ms = 10
# 微批处理模式配置(小批量处理)
[websocket.micro_batch]
batch_size = 5
max_delay_ms = 50
# 批量处理模式配置(大批量处理)
[websocket.batch]
batch_size = 25
max_delay_ms = 500
# 日志配置
[log]
level = "info"