# keentuned **Repository Path**: anolis/keentuned ## Basic Information - **Project Name**: keentuned - **Description**: KeenTune 是一款AI算法与专家知识库双轮驱动的操作系统全栈式智能优化产品,为主流的操作系统提供轻量化、跨平台的一键式性能调优,让应用在智能定制的运行环境发挥最优性能。 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 131 - **Forks**: 35 - **Created**: 2021-11-11 - **Last Updated**: 2025-05-16 ## Categories & Tags **Categories**: system-optimization **Tags**: None ## README # KeenTune-daemon(Keentuned) ## INTRODUCTION KeenTune 是一款 AI 算法与专家知识库双轮驱动的操作系统全栈式智能优化产品,为主流的操作系统提供轻量化、跨平台的一键式性能调优,让应用在智能定制的运行环境发挥最优性能。 KeenTuned 是 KeenTune 的调度管理组件,包含 CLI 和 Daemon 两个部分。CLI 模块提供用户可用的命令行接口,命令分为基础命令、静态调优相关命令、动态调优相关命令三个部分。keentuned 作为核心管控模块,负责监控其他组件、接收解析来自 CLI 的命令、按照业务处理顺序调度相关组件等。 ## Build & Install First, we can use keentuned either build 'keentuned' by source code or install by yum repo. Choose one of the following ways. ### Build by source code ```s >> sh misc/install.sh ``` ### Install by yum install First add the yum repo. If it is an Ali8 series system, directly by modifying `enabled=1` in /etc/yum.repos.d/AnolisOS-Plus.repo to enable Plus source. ```s [KeenTune] baseurl=https://mirrors.openanolis.cn/anolis/8.6/Plus/$basearch/os enabled=1 gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS gpgcheck=0 ``` And then install ```s yum clean all yum makecache yum install keentuned -y ``` ## Configuration we can find configuration file in /etc/keentune/keentuned/conf/keentund.conf ```conf [keentuned] # Basic configuration of KeenTune-Daemon(KeenTuned). VERSION_NUM = 3.1.0 ; Record the version number of keentune PORT = 9871 ; KeenTuned access port HEARTBEAT_TIME = 30 ; Heartbeat detection interval(unit: seconds), recommended value 30 # Timeout (unit: minute) # benchmark timeout BENCHMARK_TIMEOUT = 30 # sensitize train timeout SENSITIZE_TIMEOUT = 30 # set to keentune-target timeout TARGET_SET_TIMEOUT = 30 KEENTUNED_HOME = /etc/keentune/keentuned ; KeenTuned default configuration root location DUMP_HOME = /var/keentune/keentuned ; Dump home is the working directory for KeenTune job execution result ; configuration about configuration dumping DUMP_BASELINE_CONFIGURATION = false ; If dump the baseline configuration. DUMP_TUNING_CONFIGURATION = false ; If dump the intermediate configuration. DUMP_BEST_CONFIGURATION = true ; If dump the best configuration. # Backup all the domains list for init target BACKUP_ALL = false ; benchmark replay duplicately round BASELINE_BENCH_ROUND = 5 ; Benchmark execution rounds of baseline TUNING_BENCH_ROUND = 3 ; Benchmark execution rounds during tuning execution RECHECK_BENCH_ROUND = 4 ; Benchmark execution rounds after tuning for recheck ; configuration about log LOGFILE_LEVEL = DEBUG ; logfile log level, i.e. INFO, DEBUG, WARN, FATAL LOGFILE_NAME = keentuned.log ; logfile name. LOGFILE_INTERVAL = 2 ; logfile interval LOGFILE_BACKUP_COUNT = 14 ; logfile backup count [brain] # Topology of brain and basic configuration about brain. BRAIN_IP = localhost ; The machine ip address to depoly keentune-brain. BRAIN_PORT = 9872 ; The service port of keentune-brain. AUTO_TUNING_ALGORITHM = tpe ; Brain optimization algorithm. i.e. tpe, hord, random SENSITIZE_ALGORITHM = Xsen ; Explainer of sensitive parameter training. i.e. Xsen, SHAPKernel, XGBTotalGain, LASSO, MI, GP [target-group-1] # Topology of target group and knobs to be tuned in target. TARGET_IP = localhost ; The machine ip address to depoly keentune-target. TARGET_PORT = 9873 ; The service port of keentune-target. PARAMETER = sysctl.json ; Knobs to be tuned in this target [bench-group-1] # Topology of bench group and benchmark script to be performed in bench. BENCH_SRC_IP = localhost ; The machine ip address to depoly keentune-bench. BENCH_SRC_PORT = 9874 ; The service port of keentune-bench. BENCH_DEST_IP = localhost ; The destination ip address in benchmark workload. BENCH_CONFIG = bench_wrk_nginx_long.json ; The configuration file of benchmark to be performed ``` ## Run After modify KeenTuned configuration file, we can deploy KeenTuned and listening to requests as ```s >> keentuned or depoly keentuned by systemctl >> systemctl start keentuned ``` ## Code structure ### API ``` api/ └── socket.go 0 directories, 1 file ``` ### CLI ``` cli ├── command.go ├── main.go └── utils.go 0 directories, 3 files ``` ### Daemon ``` daemon/ ├── main.go ├── restful.go └── service.go 0 directories, 5 files ``` ### Common ``` common/ ├── context.go ├── file.go ├── http.go ├── log.go ├── response.go └── utils.go 0 directories, 6 files ``` ### Modules ``` modules/ ├── benchgroup.go ├── brain.go ├── profile.go ├── self.go ├── sensitivity.go └── targetgroup.go 0 directories, 6 files ```