Results 1 to 14 of 14
Like Tree1Likes
  • 1 Post By Brian Cummiskey

Database error

This is a discussion on Database error within the Troubleshooting forums, part of the vBSEO SEO Plugin category; I am getting database error few times a day for last few weeks and I can't find the problem. Forum ...

  1. #1
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times

    Database error

    I am getting database error few times a day for last few weeks and I can't find the problem. Forum stays down about hour and half and then it comes online unless I restart mysql before. Yesterday I upgrade vbseo to 3.6 but nothing changed, error still showing up.
    It happening even in the early morning when traffic is 10%-15% of what I get in the evening.
    When I look in whm, memory used go to 65%-70%, mysql is still up, but database error show if you try to open forum. Server has 12GB RAM and it is very strong.


    Here are some lines :

    Code:
    Warning: mysqli_get_server_info() [function.mysqli-get-server-info]: invalid object or resource
    mysqli in .../public_html/vbseo/includes/functions_vbseo_db.php
    on line 145
    
    Warning: reset() [function.reset]: Passed variable is not an array or object in
    .../public_html/vbseo/includes/functions_vbseo_createurl.php on
    line 528
    
    Warning:  mysqli_get_server_info() [function.mysqli-get-server-info]: invalid object or resource mysqli  in .../public_html/vbseo/includes/functions_vbseo_db.php on line 148
    
    Warning: Variable passed to each() is not an array or object in .../public_html/vbseo/includes/functions_vbseo_createurl.php on line 530
    
    Warning: Cannot modify header information - headers already sent by (output started
    at .../public_html/vbseo/includes/functions_vbseo_db.php:145) in
    /home/serbian1/public_html/404.php on line 2
    
    Warning: Cannot modify header information - headers already sent by (output started
    at .../public_html/vbseo/includes/functions_vbseo_db.php:145) in
    /home/serbian1/public_html/404.php on line 3

    Thanks

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,111
    Liked
    622 times
    Blog Entries
    4
    What is the exact database error are you receiving ?
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    I don't understand what is exacts database error. When you try to open some of the pages you see standard message for it and above information.


    http://i51.tinypic.com/1z4bmkh.gif

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You need to view-source of that error page to get the full html comment of the DB error.

  5. #5
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    <!--
    Database error in vBulletin :

    mysqli_real_connect() [&lt;a href='function.mysqli-real-connect'&gt;function.mysqli-real-connect&lt;/a&gt;]: (08004/1040): Too many connections
    /home/serbian1/public_html/includes/class_core.php on line 1317

    MySQL Error :
    Error Number :
    Request Date : Thursday, October 20th 2011 @ 01:19:12 AM
    Error Date : Thursday, October 20th 2011 @ 01:19:12 AM
    Script : http://serbianforum.org/forumdisplay.php?f=0
    Referrer :
    IP Address : 188.2.113.12
    Username :
    Classname : vB_Database_MySQLi
    MySQL Version :
    -->

  6. #6
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,111
    Liked
    622 times
    Blog Entries
    4
    That error is directly related to your MySQL configuration. You need to increase MySQL max_connections value and restart MySQL
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  7. #7
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    I already have max_conections set to 500. I change it now to 800 but I think this is to much for 30k visits per day.

  8. #8
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    It's possible your wait_timeout is set to high, there by tying up the connections for X time period. 180 is generally recommended

  9. #9
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    I don't even have wait_timeout in my.cnf. After setting max_conections to 800 I have new mysql error with max_user_connections which is set to 500.


    Database error in vBulletin : mysqli_real_connect() [&lt;a href='function.mysqli-real-connect'&gt;function.mysqli-real-connect&lt;/a&gt;]: (42000/1203): User serbian1_zems already has more than 'max_user_connections' active connections /home/serbian1/public_html/includes/class_core.php on line 1317


    Should I add wait_timeout=180 ?

    Edit 1:
    -------------------------------------

    I looked in variables in phpmyadmin and I saw I have wait_timeout set to 28,800 but I still can't find it in my.cnf file.
    Where should I look for it?

    This is my my.cnf file:

    query_cache_type=1
    max_user_connections=500
    max_connections=500
    thread_cache_size=256
    table_cache=16384
    key_buffer=64M
    max_connect_errors=20
    max_allowed_packet=128M
    join_buffer=2M
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    read_rnd_buffer_size=1M
    thread_concurrency=16
    myisam_sort_buffer_size=64M
    local-infile=0
    concurrent_insert=2



    Edit2:
    ------------------------------------
    OK, I added wait_timeout=180 and restarted mysql but they I got warning and fatal error:

    Warning: require_once([path]/includes/adminfunctions_template.php) [function.require-once]: failed to open stream: Too many open files in system in [path]/includes/class_bootstrap.php(537) : eval()'d code on line 71

    Fatal error: require_once() [function.require]: Failed opening required '/home/serbian1/public_html/includes/adminfunctions_template.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/serbian1/public_html/includes/class_bootstrap.php(537) : eval()'d code on line 71

  10. #10
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    my.cnf will only over-ride defaults. If it's not set, it will run oem/default configuration.

    This is my file in my 8gb machine serving about 600 at once average.

    Note, I do NOT use mysqli, and you may have better luck using the default mysql engine instead.

    Code:
    [mysqld]
    back_log = 50
    skip-innodb
    max_connections = 1024
    key_buffer_size = 32M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 2M
    read_buffer_size = 2M
    sort_buffer_size =42M
    table_cache = 1024
    thread_cache_size = 384
    wait_timeout = 190
    connect_timeout = 10
    tmp_table_size = 64M
    max_heap_table_size = 64M
    max_allowed_packet = 64M
    net_buffer_length = 16384
    max_connect_errors = 10
    thread_concurrency = 16
    concurrent_insert = 2
    table_lock_wait_timeout = 30
    read_rnd_buffer_size = 786432
    bulk_insert_buffer_size = 8M
    query_cache_limit = 4M
    query_cache_size = 64M
    query_cache_type = 1
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = MyISAM
    
    [mysqldump]
    quick
    max_allowed_packet = 128M
    
    [myisamchk]
    key_buffer = 64M
    sort_buffer = 64M
    read_buffer = 16M
    write_buffer = 16M
    zems likes this.
    Brian Cummiskey / Crawlability Inc.
    Security vbulletin - Patch Level for all supported versions released!

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  11. #11
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    How can I change mysqli to mysql?
    Should I do it in config.php file of vbulletin?

    $config['Database']['dbtype'] = 'mysql';

    Thanks for your help.

  12. #12
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,111
    Liked
    622 times
    Blog Entries
    4
    Actually i always suggest mysqli over mysql . Mysqli always serves faster for me.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  13. #13
    Senior Member
    Real Name
    Darko
    Join Date
    Apr 2009
    Posts
    167
    Liked
    0 times
    Ok, I added wait timeout to 190, increase max_connections to 1024 and delete max_user_connections but I still getting database error for to many connections.
    I don't know what to do any more to fix this.

  14. #14
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You may want to check with your host to see if you are beeing DDoS'ed

Similar Threads

  1. Database error
    By barbaro in forum General Discussion
    Replies: 2
    Last Post: 02-07-2009, 02:30 PM
  2. 3.2.0 RC5 Database error
    By MissKalunji in forum Troubleshooting
    Replies: 9
    Last Post: 05-03-2008, 09:52 AM
  3. Database Error for 3.6.10
    By CoffeeToki in forum Bug Reporting
    Replies: 8
    Last Post: 05-01-2008, 12:39 AM
  4. Database error
    By webgroup in forum Troubleshooting
    Replies: 1
    Last Post: 05-08-2007, 05:34 PM
  5. Database error.
    By ChefTalk in forum Troubleshooting
    Replies: 3
    Last Post: 03-24-2007, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •