天天看點

mysql 記錄

mysql 區分大小寫設定:

my.cnf

lower_case_table_names = 0

0:區分大小寫,1:不區分大小寫

修改swappiness參數,讓作業系統盡可能最大程度利用實體記憶體,而非虛拟記憶體

$cat /proc/sys/vm/swappiness

60

$echo 0> /proc/sys/vm/swappiness

<code>$echo </code><code>"vm.swappiness=0"</code><code>&gt;&gt; </code><code>/etc/sysctl</code><code>.conf</code>

<code>#立即生效</code>

<code>$ sysctl -p</code>

如何檢視那個程序占用swap的大小,如下:

1

2

3

4

5

6

7

8

<code>第一步:</code>

<code>$ </code><code>top</code>

<code>第二步:</code>

<code>按大寫的O</code>

<code>第三步:</code>

<code>輸入小寫字母p</code>

<code>第四步:</code>

<code>回車</code>

架構 master A ——–&gt; slave B——-&gt; slave C

log_slave_updates  是否從伺服器從主伺服器收到的更新應記入從伺服器自己的二進制日志。要想生效,必須啟用從伺服器的二進制記錄。

slave_skip_errors =&gt; ALL # 從伺服器忽略所有錯誤

主從同步延時:

Because the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file. Writing and flushing operations are time expensive for only one transaction. It will be better to perform these operations for several transactions instead of only one.

執行後解決,讓innodb_flush_log_at_trx_commit=0  #不緩存,讓事務實時寫入。

本文轉自 Art_Hero 51CTO部落格,原文連結:http://blog.51cto.com/curran/1322963,如需轉載請自行聯系原作者

上一篇: DNS CentOS 6
下一篇: Shell Loop

繼續閱讀