18 Jul 2018

ಠ_ಠ!!! Kinda Freelancer


DB:

So our seeking paths converge to sysbench, with forerunner’s benchmark results, sysbench’s manual, and its origin & details

  # Easy installation (given MySQL running in InnoDB):
  sudo apt-get install sysbench

  # Create DB (through MySQL cli)
  mysql> create database dbtest;

  # Sysbench OLTP's prepare:
  sysbench --test=oltp \
    --oltp-table-size=1000000 \
    --mysql-db=dbtest --mysql-user=[YOURAWESOMENAME] --mysql-password=[YOURPWD] \
    prepare

  # Sysbench OLTP's run:
  sysbench --test=oltp --num-threads=200 --max-time=60 \
    --oltp-table-size=1000000 --oltp-test-mode=complex --oltp-reconnect-mode=session \
    --max-requests=0 --mysql-db=dbtest --mysql-user=root --mysql-password=soqqr123 \
    run

  # Remark:
  ## --test=YOURAWESOMETEST (mandatory, for test mode)
  ## --oltp-BALBLA (options dedicated to oltp test mode)
  ## --mysql-BLABLA (options dedicated to mysql settings)
  • Unleash the max connections of mysql server
    echo "[mysqld]" >> /etc/mysql/my.cnf
    
    # To avoid: max connection problem
    echo "max_connections=8192" >> /etc/mysql/my.cnf
    echo "LimitNOFILE=8192" >> /lib/systemd/system/mysql.service
    
    # To avoid: max_prepared_stmt_count error
    echo "max_prepared_stmt_count=65528" >> /etc/mysql/my.cnf
    
    systemctl daemon-reload
    systemctl restart mysql.service
    

Songs: