File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
工作流由原先的` 前端提交任务->后端处理->plmber执行 ` 改为` 前端提交任务->后端处理->消息队列<-rscheduler拉取任务->hicli执行 ` ,引入的消息队列解耦了后端逻辑与任务调度与执行逻辑,使` hiplotlib ` 得以水平拓展,大大提高任务处理效率,并且通过拉模式主动从消息队列中消费任务,可根据自身状态动态调整拉取任务数量,一定程度上防止了CPU负载过高和内存溢出
8
8
9
+ ## QuickStart
10
+
11
+ 1 . 本地需要有部署rabbitMQ并在` config/config.yaml ` 中配置好url
12
+ 2 . ` go run main.go ` 启动rscheduler
13
+ 3 . 配置并运行` mq/rabbitmq_test.go ` 模拟新任务的产生
14
+ 4 . 查看结果及日志
15
+
9
16
## 代码实现
10
17
11
18
在` rscheduler ` 代码实现中,有三个核心概念,` scheduler ` 、` processor ` 、` task `
Original file line number Diff line number Diff line change
1
+ rabbitmq :
2
+ url :
amqp://lxs:[email protected] :5672/
3
+ taskQueueName : common
4
+
5
+ taskLimit :
6
+ maxCPU : 90 # 允许创建新Processor的最大CPU占用 0%-100%
7
+ maxMem : 90 # 允许创建新Processor的最大内存占用 0%-100%
8
+ maxBusyProcessor : 2 # 最大同时运行的Processor数量 可设置为CPU核心数
9
+ maxIdleProcessor : 20 # 最大空闲的Processor数量 会占用一定内存
10
+ maxBusyProcessorMem : 1024 # MB 一个运行Processor最大占用内存
11
+ maxIdleProcessorMem : 300 # MB 一个空闲Processor最大占用内存
12
+ taskTimeout : 300 # seconds 任务超时时间
You can’t perform that action at this time.
0 commit comments