The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Slow queries not being logged

Discussion in 'Workarounds and Optimization' started by mk2mark, Aug 20, 2014.

  1. mk2mark

    mk2mark Member

    Joined:
    Mar 6, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I have slow query logging turned on, but for some reason the log file is not being created or populated. What am I doing wrong?

    I've attached my whole my.conf, feel free to point out any recommendations:
    Code:
    [mysqld]
    federated
    skip-networking
    
    slow_query_log=1
    slow_query_log_file="/home/tools/log-slow-queries.log"
    long_query_time = 3
    log_queries_not_using_indexes
    
    innodb_file_per_table=1
    local-infile=0
    default-storage-engine=InnoDB
    open_files_limit=2270
    max_allowed_packet=268435456
    max_user_connections=30
    max_connections=500
    
    slow_query_log_file= /home/tools/slow.logs
    
    innodb_flush_method = O_DIRECT
    innodb_log_file_size = 256M
    innodb_log_buffer_size = 8M
    
    query-cache-type = 1
    query_cache_size=1024M
    innodb_buffer_pool_size=1024M
    
    join_buffer_size = 4M
    table_open_cache = 700
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    What version of MySQL is installed on your system? I notice you have two entries for "slow_query_log_file" in your /etc/my.cnf file.

    Thank you.
     
  3. mk2mark

    mk2mark Member

    Joined:
    Mar 6, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm using version 5.6.

    Just removed the second entry (duh), still no queries being logged.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. mk2mark

    mk2mark Member

    Joined:
    Mar 6, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes and yes, I ran the following:

    SELECT SLEEP(10);
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You might try changing the log file to a path such as:

    /var/lib/mysql/log-slow-queries.log

    It shouldn't make a difference, but it's worth attempting. Also, make sure you create the log file before entries are populated.

    Thank you.
     
  7. mk2mark

    mk2mark Member

    Joined:
    Mar 6, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    No difference as you guessed.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket so we can take a closer look and see if you've made a simple mistake in the /etc/my.cnf file. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page