使用TCMalloc 最佳化MySQL

來源:互聯網
上載者:User

標籤:mysql

使用TCMalloc 最佳化MySQL
http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz

http://gperftools.googlecode.com/files/gperftools-2.1.tar.gz

參照MySQL管理之道 19頁進行安裝
tar -xf libunwind-1.1.tar.gz
cd libunwind-1.1
CFLAGS=-fPIC ./configure --enable-shared
make CFLAGS=-fPIC
make CFLAGS=-fPIC install

tar -xf gperftools-2.1.tar.gz
cd gperftools-2.1
./configure
make
make install

ls -l /usr/local/lib/libtcmalloc.so
ls -l /usr/local/lib/libunwind.so

將/usr/local/lib >>/etc/ld.so.conf
ldconfig
這個步驟很重要 第一次啟動MySQL就報錯了
修改
vim /usr/local/mysql/bin/mysqld_safe
# executing mysqld_safe 在此句下面添加如下內容
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so

然後啟動MySQL:
/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/etc/my.cnf &

確認MySQL是否生效
[[email protected] ~]# lsof -n |grep tcmalloc
mysqld    21167  mysql  mem       REG                8,3    1951006    3358698 /usr/local/lib/libtcmalloc.so.4.1.2
[[email protected] ~]# lsof |grep -i libtcmalloc.so
mysqld    21167  mysql  mem       REG                8,3    1951006    3358698 /usr/local/lib/libtcmalloc.so.4.1.2


尋找Linux IP衝突情況
arp-scan -I eth0 -l


本文出自 “醉寒江” 部落格,請務必保留此出處http://cjlozbg.blog.51cto.com/3513565/1723380

使用TCMalloc 最佳化MySQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.