IT Japan

MySQL with tcmalloc 본문

MySQL

MySQL with tcmalloc

swhwang 2017. 5. 31. 17:24
반응형

MySQL with tcmalloc

What is tcmalloc?

tcmalloc은 중앙 메모리 관리자와 Thread 메모리 관리자를 구분하여 메모리를 관리하는 구글에서 공개한 메모리 할당 라이브러리입니다.
Thread에서는 작은 크기(32K) 메모리를 할당하고, 부족 시 중앙 메모리 관리자에서 직접 메모리 할당을 받으며, 메모리 해제 요청은 Thread별로 메모리 관리자가 직접 처리.
Fast, multi-threaded malloc() and nifty performance analysis tools

How to use tcmalloc on MySQL?

Install

  • 64bit는 설치 전에 libunwind 설치
    wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-beta.tar.gz
    tar zxvf libunwind-0.99-beta.tar.gz
    cd libunwind-0.99-beta
    ./configure
    cd ..
    rm -rf ./libunwind-0.99-beta*
  • 설치 후 MySQL 컴파일 시 옵션을 추가해서 사용

    wget https://gperftools.googlecode.com/files/gperftools-2.0.tar.gz
    tar zxvf gperftools-2.0.tar.gz
    cd ./gperftools-2.0
    ./configure
    make && make install
    cd ..
    rm -rf ./gperftools-2.0*

  • configure 시에 Error
    ...
    configure: error: C++ compiler cannot create executables
    • gcc-c++ install
      # yum install gcc-c++

Benchmark?

  • 메모리에서 수행되는 Write의 경우 20% 정도의 성능 향상
  • 8Core 이상의 장비에서는 추가 Benchamrk 수행이 필요


반응형

'MySQL' 카테고리의 다른 글

MySQL 사용 사례 (페이스북)  (0) 2017.06.02
MySQL의 릴리즈 사이클  (0) 2017.06.02
Index Condition Pushdown  (0) 2017.05.31
PaceMaker+DRBD구축4 【MySQL인스톨】  (0) 2017.05.26
MySQL의 심플유저 계정 설정  (0) 2017.05.25
Comments