Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
@humorless
humorless / linux_performance.md
Created April 28, 2016 06:37 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

package main
import (
"encoding/json"
"fmt"
"github.com/powerman/rpc-codec/jsonrpc2"
"net/http"
"net/rpc"
)
#基本概念:
在公司develop branch裡的程式碼,會被自動做成 latest image
指令:
cd DockerCompose-OpenFalcon
sudo vim owl.yml // 把對應的image的tag改成 latest
docker-compose -f owl.yml pull fe // 假設要更新的docker image是fe
docker stop fe // 停止正在運行中的fe
docker-compose -f owl.yml up -d fe // 透過docker-compose 重新啟動fe,並且套用latest image
更新 docker:
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
$ sudo vim /etc/apt/sources.list.d/docker.list
# for ubuntu 14.04 改成 deb https://apt.dockerproject.org/repo ubuntu-trusty main
$ sudo apt-get upgrade docker-engine
https://zh.wikipedia.org/wiki/Wikipedia:%E5%88%97%E6%98%8E%E6%9D%A5%E6%BA%90#.E6.96.B0.E8.81.9E
<ref>{{cite news |language = 語言 |author = 作者 |coauthors = 聯名作者 |url = 網址 |title = 標題 |publisher = 發行商 |pages = 該新聞的頁碼 |date = 該新聞的日期 |accessdate = 查閱日期}}</ref>
新聞
新聞稿
{{Cite press release}}
報紙
可參考{{Cite news}}、{{News reference}}
電視台或網路媒體
return (
<div className='alarms-table'>
<Table className={`table ${OWL.state.alert.showLess ? 'less' : 'more'}`}>
<Table.Head className="_tdAdapter">
<div>
<input type="checkbox"
key={`all ${OWL.state.alert.checkboxesIgnoredColumns.indexOf('all') > -1}`}
value='all'
checked={OWL.state.alert.checkboxesIgnoredColumns.indexOf('all') > -1}
onChange={this.checkboxOnChangeIgnored} />
alertRows.push (
<tr key={`${key} ${alert.process}`} className={trClassName}>
<td>
<input type="checkbox"
key={`{alert.hash} ${OWL.state.alert.checkboxesIgnoredColumns.indexOf(alert.hash) > -1}`}
value={alert.hash}
checked={OWL.state.alert.checkboxesIgnoredColumns.indexOf(alert.hash) > -1}
onChange={this.checkboxOnChangeIgnored} />
</td>
<td>
SELECT id, event_caseId, step, cond, timestamp, status
FROM
(SELECT *, IF(@id=@id:=result.event_caseId,@count:=@count+1,@count:=0) as pos
FROM
(SELECT e.id, e.event_caseId, e.step, e.cond, e.timestamp, e.status
FROM falcon_portal.events AS e
INNER JOIN
(SELECT a.id, a.endpoint, a.metric, a.note, a.priority, a.status, a.timestamp,
a.update_at, a.template_id, a.tpl_creator, a.process_status
FROM falcon_portal.event_cases AS a
case 1
如果只要測試 fe 的話,可以只啟動部分的模組,例如
fe, query, graph, mysql, redis
case 2
一次只啟動一個 container 的指令
#docker-compose -f owl.yml up -d graph
case 3
觀察log
1. 先修改 owl.yml 增加一個port mapping 15672:15672
2. 啟動 mq 的 container 
#docker-compose -f owl.yml up -d mq
3. 登入 mq 的 container
#docker exec -ti mq bash
#rabbitmq-plugins enable rabbitmq_management
4. 開 browser -> http://10.20.30.40:15672