gos-log日志檢索系統(tǒng)
gos-log 基于Go語言的輕量級高性能的大日志檢索系統(tǒng)
開源地址
gos-log
https://gitee.com/dianjiu/gos-log
https://github.com/dianjiu/gos-log
gos-log-vue
https://gitee.com/dianjiu/gos-log-vue
https://github.com/dianjiu/gos-log-vue
演示地址
賬號:admin
密碼:admin
演示截圖
登陸頁
客戶端
項目管理
日志查找
項目構建
gos-log
# 進入go工作空間 cd ~/codes/go/src # 配置go國內代理 sudo vim ~/.bash_profile # 新增如下內容 export GOPATH=/Users/dianjiu/Codes/go export GOROOT=/usr/local/go export GOBIN=$GOPATH/bin export PATH=$PATH:$GOROOT/bin:$GOPATH/bin export GOPROXY=https://goproxy.cn export GO111MODULE=on # 使配置生效 source ~/.bash_profile # 安裝beego依賴 go get github.com/astaxie/beego go get github.com/beego/bee # 克隆項目 git clone https://github.com/dianjiu/gos-log.git # 分別進入項目目錄 cd gos-log/logs #進入服務端 cd gos-log/logc #進入客戶端 # 啟動服務 bee run
gos-log-vue
# 克隆項目 git clone https://github.com/dianjiu/gos-log-vue.git # 進入項目目錄 cd gos-log-vue # 安裝依賴 yarn install # 啟動服務 yarn run dev
項目部署
gos-log
# 打包服務端 cd gos-log/logs bee pack -be GOOS=linux # 打包客戶端 cd gos-log/logc bee pack -be GOOS=linux # 準備數(shù)據(jù)庫 見gos-log項目下的sql文件夾
gos-log-logs
# 解壓縮 tar -zxf logs.tar.gz -C ./ # 授權 chmod 777 logs # 修改數(shù)據(jù)庫配置 sudo vim conf/app.conf # 啟動 nohup ./logs >> logs.log &
gos-log-logc
# 解壓縮 tar -zxf logc.tar.gz -C ./ # 授權 chmod 777 logc # 啟動 nohup ./logc >> logc.log &
gos-log-vue
# 打包構建 yarn run build # 把dist目錄下的文件拿到服務器部署即可 # nginx部署如下nginx.conf server { listen 2022; server_name localhost; location / { root /web/gos-log/vue; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://127.0.0.1:2021; } }
性能測試
系統(tǒng)硬件
| CPU | Intel? Core? i5-10210U CPU @ 1.60GHz × 8 |
| 內存 | 16G |
| 硬盤 | 512.1 GB |
| 操作系統(tǒng) | Ubuntu 20.04.2 LTS 64位 |
| GNOME版本 | 3.36.8 |
系統(tǒng)環(huán)境
| Java環(huán)境 | ORACLE JDK13.0.2 |
| Go環(huán)境 | GO1.15.7 linux/amd64 |
| Python環(huán)境 | Python 3.8.5 |
性能對比
單文件逐行讀取 17.8G test.log (單線程讀取)
| 語言 | test1 | test2 | test3 | test4 | test5 | 總耗時 | 平均耗時 |
| Go | 32.99s | 34.24s | 30.33s | 31.21s | 35.70s | 164.16s | 32.83s |
| Python | 32分鐘還沒執(zhí)行完 | ||||||
| Java | 226s | 206s | 153s | 219s | 183s | 987s | 197.4s |
評論
圖片
表情
