1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 some server log errors

Discussion in 'Troubleshooting and Problems' started by xmlxp, Feb 1, 2012.

  1. xmlxp

    xmlxp Active Member

    I got today thease errors:

    Code:
     
     
     
    Lost connection to MySQL server at 'sending authentication information', system error: 32 اليوم الساعة 1:37 مساءاً- /home/vbcom/public_html/community/library/Zend/Db/Adapter/Mysqli.php:333
     
     
    Lost connection to MySQL server at 'sending password information', system error: 32 اليوم الساعة 1:34 مساءاً- library/Zend/Db/Adapter/Mysqli.php:333
     
     
    Lost connection to MySQL server at 'sending authentication information', system error: 32 اليوم الساعة 12:04 مساءاً- /home/vbcom/public_html/community/library/Zend/Db/Adapter/Mysqli.php:333
     
     
    Lost connection to MySQL server at 'sending password information', system error: 32 اليوم الساعة 12:04 مساءاً- library/Zend/Db/Adapter/Mysqli.php:333
    
    and it happen the server load hit the sky around 40 at the smae timing of those errors, and i had to restart server mysql to make the site accesseble again

    any hint to analyse that?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That error is caused by one of these MySQL settings:

    wait_timeout
    max_allowed_packet


    If you don't manage your own server then you need to ask your host or server person to increase these settings.
     
  3. xmlxp

    xmlxp Active Member

    Hello jake

    currently in /etc/my.cnf
    max_allowed_packet = 64M
    wait_timeout = 180

    take a a look at my WHM Daily Process Log
    WHM.png
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try increasing those settings.

    If the connection isn't being closed as a result of those settings then maybe the server itself is crashing or is being restarted. Check the uptime on the MySQL server.
     
  5. xmlxp

    xmlxp Active Member

    increased to
    max_allowed_packet = 128M
    wait_timeout = 320

    i hope this solve the issue
     
  6. xmlxp

    xmlxp Active Member

    again, i had this issue 2 days ao and today also

    today,once it started to happen i took screen shot of top command

    highload.png

    since the server is not using any swap memory then the server dosnt need any ram increase.

    i also checked to top proccwss from WHM

    WHM.png

    i checked the thread number of 306882 and its only 3 posts thread and its 3 months old, why would it cause 64% of CPU use?


    i checked also tuning-primer.sh for my server and i got this:


    Code:
    [root@host ~]# sh tuning-primer.sh
     
            -- MYSQL PERFORMANCE TUNING PRIMER --
     
                - By: Matthew Montgomery -
     
    MySQL Version 5.0.92-community-log i686
     
     
    Uptime = 2 days 3 hrs 15 min 53 sec
     
    Avg. qps = 40
     
    Total Questions = 7409722
     
    Threads Connected = 3
     
     
    Server has been running for over 48hrs.
     
    It should be safe to follow these recommendations
     
    To find out more information on how each of these
     
    runtime variables effects performance visit:
     
    http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
     
    Visit http://www.mysql.com/products/enterprise/advisors.html
     
    for info about MySQL's Enterprise Monitoring and Advisory Service
     
     
     
    SLOW QUERIES
     
    The slow query log is enabled.
     
    Current long_query_time = 3 sec.
     
    You have 209 out of 7409771 that take longer than 3 sec. to complete
     
    Your long_query_time seems to be fine
     
     
     
    BINARY UPDATE LOG
     
    The binary update log is NOT enabled.
     
    You will not be able to do point in time recovery
     
    See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
     
     
     
    WORKER THREADS
     
    Current thread_cache_size = 256
     
    Current threads_cached = 41
     
    Current threads_per_sec = 0
     
    Historic threads_per_sec = 0
     
    Your thread_cache_size is fine
     
     
     
    MAX CONNECTIONS
     
    Current max_connections = 500
     
    Current threads_connected = 3
     
    Historic max_used_connections = 42
     
    The number of used connections is 8% of the configured maximum.
     
    You are using less than 10% of your configured max_connections.
     
    Lowering max_connections could help to avoid an over-allocation of memory
     
    See "MEMORY USAGE" section to make sure you are not over-allocating
     
     
     
    No InnoDB Support Enabled!
     
     
     
    MEMORY USAGE
     
    Max Memory Ever Allocated : 361 M
     
    Configured Max Per-thread Buffers : 2.41 G
     
    Configured Max Global Buffers : 154 M
     
    Configured Max Memory Limit : 2.56 G
     
    Physical Memory : 3.90 G
     
    Max memory limit seem to be within acceptable norms
     
     
     
    KEY BUFFER
     
    Current MyISAM index space = 3.78 G
     
    Current key_buffer_size = 80 M
     
    Key cache miss rate is 1 : 309
     
    Key buffer free ratio = 0 %
     
    You could increase key_buffer_size
     
    It is safe to raise this up to 1/4 of total system memory;
     
    assuming this is a dedicated database server.
     
     
     
    QUERY CACHE
     
    Query cache is enabled
     
    Current query_cache_size = 64 M
     
    Current query_cache_used = 48 M
     
    Current query_cache_limit = 4 M
     
    Current Query cache Memory fill ratio = 75.67 %
     
    Current query_cache_min_res_unit = 4 K
     
    MySQL won't cache query results that are larger than query_cache_limit in size
     
     
     
    SORT OPERATIONS
     
    Current sort_buffer_size = 2 M
     
    Current read_rnd_buffer_size = 768 K
     
    Sort buffer seems to be fine
     
     
     
    JOINS
     
    Current join_buffer_size = 1.00 M
     
    You have had 55 queries where a join could not use an index properly
     
    You should enable "log-queries-not-using-indexes"
     
    Then look for non indexed joins in the slow query log.
     
    If you are unable to optimize your queries you may want to increase your
     
    join_buffer_size to accommodate larger joins in one pass.
     
     
     
    Note! This script will still suggest raising the join_buffer_size when
     
    ANY joins not using indexes are found.
     
     
     
    OPEN FILES LIMIT
     
    Current open_files_limit = 5510 files
     
    The open_files_limit should typically be set to at least 2x-3x
     
    that of table_cache if you have heavy MyISAM usage.
     
    Your open_files_limit value seems to be fine
     
     
     
    TABLE CACHE
     
    Current table_cache value = 2500 tables
     
    You have a total of 386 tables
     
    You have 486 open tables.
     
    The table_cache value seems to be fine
     
     
     
    TEMP TABLES
     
    Current max_heap_table_size = 64 M
     
    Current tmp_table_size = 64 M
     
    Of 2442 temp tables, 41% were created on disk
     
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size
     
    to reduce the number of disk-based temporary tables
     
    Note! BLOB and TEXT columns are not allow in memory tables.
     
    If you are using these columns raising these values might not impact your
     
    ratio of on disk temp tables.
     
     
     
    TABLE SCANS
     
    Current read_buffer_size = 1 M
     
    Current table scan ratio = 35 : 1
     
    read_buffer_size seems to be fine
     
     
     
    TABLE LOCKING
     
    Current Lock Wait ratio = 1 : 7120
     
    Your table locking seems to be fine
     
     
     
    [root@host ~]#
     
    
    any comments?
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    XenForo uses InnoDB. I don't know if this is related to the original error though.

    MySQL is also using a lot of CPU. You may want to check your MySQL processlist. Run this shell command to connect to mysql:

    mysql -umysqluser -pmysqlpass

    That will take you to the mysql prompt. Then run this query in the mysql prompt:

    SHOW PROCESSLIST;
     
  8. Walter

    Walter Well-Known Member

    Do you really need 500 connections? I would lower this to e.g. 200 and see if it fits. This conserves memory.

    Why that? Xenforo uses InnoDB for most of its tables???

    Try doubling this. And what says your slow-query log?

    But you really should hire someone trying to optimize your settings....
     
  9. xmlxp

    xmlxp Active Member

    yes my.cnf was optimised for vbulletin 3.x and InnoDB was disabled as suggested by eva2000 the expert of server configurations in vBulletin forums. I enabled now InnoDB and increased key_buffer to 160M

    before adding thease varaibles to my.cnf i want to make sure if there are ok or need to be changed to another values:
    Code:
    innodb_log_buffer_size = 8M
    innodb_log_file_size = 32M
    innodb_flush_log_at_trx_commit = 2
    innodb_flush_method = O_DIRECT
    innodb_thread_concurrency = 8
    innodb_additional_mem_pool_size = 8M
    innodb_buffer_pool_size = 2200M
    innodb_fast_shutdown = 0
    
    what command line i should run to get the wanted values from slow-query log ?
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

  11. xmlxp

    xmlxp Active Member

  12. Walter

    Walter Well-Known Member

    The full command is

    alter table tablename engine=innodb

    You have to do this per table. Please read http://dev.mysql.com/doc/
     
  13. xmlxp

    xmlxp Active Member

    converting 132 tables one by one is really too long :(

    and its larg forum , 3.5 millions post, should i cloose the forum before i start converting to avoid high server load to prevent it from crashing? should i make backup first?
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  15. xmlxp

    xmlxp Active Member

    hello Jake
    i have no idea about scripts modifications, i will go to converting manually option, thanks anyway

    for the sake of priority, which are the most important tables i should convert to innodb right now and leave the others for later?
     
  16. simbolo

    simbolo Well-Known Member

    PHP:
    <?php
    $db 
    mysql_connect('localhost','myuser_mydbuser','mypassword');
    if(!
    $db) echo "Cannot connect to the database - incorrect details";
    mysql_select_db('myuser_mydbname');
    $result=mysql_query('show tables');
    $tables_to_ignore = array('xf_import_log','xf_search_index','xf_session','xf_session_adminxf_attachment_view','xf_session_activity','xf_thread_view');
    while(
    $tables mysql_fetch_array($result)) {
        foreach (
    $tables as $key => $value) {
            if(!
    in_array($value$tables_to_ignore)){
                
    mysql_query("ALTER TABLE $value ENGINE=innodb");
            }
        }
    }
    echo 
    "Your database tables have been changed to innodb!";
    ?>
    These are only ones that shouldn't be innodb. I haven't tested this so you'll want to run this on TEST db first. Seriously on a TEST DB first.
     
    BamaStangGuy likes this.
  17. Chris H.

    Chris H. Member

    Just for the record, there is a mistake in this query in the list of tables to ignore. It should be:

    PHP:
    $tables_to_ignore = array('xf_import_log','xf_search_index','xf_session','xf_session_admin','xf_attachment_view','xf_session_activity','xf_thread_view');
    If you've previously ran this script, you'll need to change xf_attachment_view to memory and xf_session_admin to MyISAM:

    Code:
    alter table xf_attachment_view ENGINE=memory;
    alter table xf_session_admin ENGINE=MyISAM;
     
    simbolo and BamaStangGuy like this.
  18. simbolo

    simbolo Well-Known Member

    Thanks for update Chris
     

Share This Page