Skip to main content

MySQL Optimization

Comments

9 comments

  • thinkbot
    add this in my.cnf under [mysqld] query_cache_type = 1 query_cache_size = 30M table_cache_size = 1000 thread_cache_size = 20 join_buffer_size = 512K
    0
  • johnchristy
    This didnt work I got this error while restarting mysql : Starting MySQL... ERROR! The server quit without updating PID file. I had to remove these entries from my.cnf and restart. Any idea?
    0
  • thinkbot
    can you copy your my.cnf here ?
    0
  • cPanelMichael
    [quote="johnchristy, post: 1631351">I got this error while restarting mysql : Starting MySQL... ERROR! The server quit without updating PID file. I had to remove these entries from my.cnf and restart. Any idea?
    Could you provide the output from your MySQL error log (/var/lib/mysql/$hostname.err) when adding those entries? It should output the specific entry that was invalid. Thank you.
    0
  • johnchristy
    Sure [~]# cat /etc/my.cnf [mysqld] innodb_file_per_table=1 local-infile=0 log-slow-queries=/var/lib/mysql/slow.log open_files_limit=17058
    0
  • johnchristy
    Hi michael 140429 10:30:00 mysqld_safe mysqld from pid file /var/lib/mysql/hostname.pid ended 140429 10:30:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 140429 10:30:01 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead. 140429 10:30:01 [Note] Plugin 'FEDERATED' is disabled. 140429 10:30:01 InnoDB: The InnoDB memory heap is disabled 140429 10:30:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140429 10:30:01 InnoDB: Compressed tables use zlib 1.2.3 140429 10:30:01 InnoDB: Using Linux native AIO 140429 10:30:01 InnoDB: Initializing buffer pool, size = 128.0M 140429 10:30:01 InnoDB: Completed initialization of buffer pool 140429 10:30:01 InnoDB: highest supported file format is Barracuda. 140429 10:30:01 InnoDB: Waiting for the background threads to start 140429 10:30:02 InnoDB: 5.5.36 started; log sequence number 192786833 140429 10:30:02 [ERROR] /usr/sbin/mysqld: unknown variable 'table_cache_size=1000' 140429 10:30:02 [ERROR] Aborting 140429 10:30:02 InnoDB: Starting shutdown... 140429 10:30:03 InnoDB: Shutdown completed; log sequence number 192786833 140429 10:30:03 [Note] /usr/sbin/mysqld: Shutdown complete 140429 10:30:03 mysqld_safe mysqld from pid file /var/lib/mysql/hostname.pid ended [COLOR="silver">- - - Updated - - - the variable is table_cache and not table_cache_size? and michael these values should work best with my setup? query_cache_type = 1 query_cache_size = 30M table_cache_size = 1000 thread_cache_size = 20 join_buffer_size = 512K
    0
  • Archmactrix
    You should use correct variables for your mysql version: Use: [QUOTE]slow_query_log_file=/var/lib/mysql/slow.log table_open_cache=your-value
    Instead of: [QUOTE]table_cache_size = your-value log-slow-queries=/var/lib/mysql/slow.log
    I'm not sure if slow_query_log_file= enables the log, or you need to use the slow_query_log variable also. edit: Either of these would work if you need to use it: slow_query_log slow_query_log=1
    0
  • thinkbot
    Yes sorry use table_cache instead of table_cache_size in newer versions its table_cache_size
    0
  • johnchristy
    cool, Ill try this and will update you
    0

Please sign in to leave a comment.