vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   vBulletin DB Errors recently (https://vborg.vbsupport.ru/showthread.php?t=310933)

pjkcards 05-01-2014 03:26 AM

vBulletin DB Errors recently
 
I've been getting a few of these recently, but didn't happen much before. Travel has remained mostly constant for the last year so not sure why it is happening now:
Quote:

Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)
/home/x/public_html/sss/forum/includes/class_core.php on line 317
I contacted my host about this and they replied with this:
Quote:

[--] Total buffers: 770.0M global + 9.3M per thread (500 max threads)
===

This means mysql by itself, without apache, without exim, just mysql, has 770 MB of memory just to run. Then, each connection adds another 9.3 MB. Your server only has 2560 MB of RAM:
===
root@host [~]# free -m
total used free shared buffers cached
Mem: 2560 599 1960 0 0 0
-/+ buffers/cache: 599 1960
Swap: 0 0 0
===

When the server runs completely out of memory, the kernel throws an OOM (Out Of Memory) error, wherein it starts killing processes to prevent the server itself from crashing. It usually starts with the processes taking up the most memory. If the mysql process is taking the most memory, it is likely to be the one chosen to be killed. However, if mysql is killed in this way, it can cause crashed tables. If a table is crashed, all subsequent queries to that table will fail, which usually has a much greater impact on the site than a few queries failing momentarily due to having reached the max_connections amount.

For this reason, it is not recommended to allow mysql to use more than 80% of the server's memory, to help prevent this issue from occuring. At 137 allowed connections, that would be 770M +9.3M * 137, or about 2044 MB, which is just slightly under 80% of the total ram of 2560 MB. This is how I arrived at this number for a max_connections to try for now.

If you do need more connections than this simultaneously, then it is very strongly recommended to reduce other mysql variables to either reduce the memory overhead (the ammount mysql takes even with zero connections), or the ammount of memory taken for each connection. If you do not know what these values need to be set to, it is strongly recommended to find a developer to help you. Once you know what the settings need to be set to, I can help you set them, if you let me know what settings need to be changed and what they need to be set to.

Another option of course is to add more memory to the server, however, if the site is inefficiently coded, it may still take up the server's resources even if there are more.

In the last hour, there have been 204 joins performed without indexes, and many temporary tables created to the disk:
===
[--] Up for: 1h 5m 11s (301K q [77.047 qps], 15K conn, TX: 7B, RX: 69M)
[!!] Joins performed without indexes: 204
[!!] Temporary tables created on disk: 46% (5K on disk / 12K total)
===

I strongly recommend finding a developer to help you fix these queries.
Any ideas how to fix this? Do I need to add more memory or there another solution? I'm running vB 4.2.1 and have been pretty much since it came out. And here are the versions of Apache, PHP, and mySQL:
Apache version 2.2.21
PHP version 5.2.17
MySQL version 5.1.73-cll

Thanks.

Zachery 05-01-2014 03:52 AM

You should update MySQL, however, according to that free, you have 1.7gb of free memory, and are only using 700mb.

You should reduce the number of connections though, chances are you don't need 500.

ForceHSS 05-01-2014 04:18 AM

the line 317 is to do with the username and password in your config.php

cellarius 05-01-2014 11:03 AM

Quote:

Originally Posted by ForceHSS (Post 2495594)
the line 317 is to do with the username and password in your config.php

Yeah, well, of course you need username and password to connect to the database, that's the whole point of it. But what does that have to do with the error of the OP? He does not have a password or username issue.

Zachery 05-01-2014 06:22 PM

The error is just stating MySQL can't connect, the error lines from the software are pretty pointless.

ForceHSS 05-01-2014 06:32 PM

Quote:

Originally Posted by cellarius (Post 2495634)
Yeah, well, of course you need a username and password to connect to the database, that's the whole point of it. But what does that have to do with the error of the OP? He does not have a password or username issue.

Pointing out what the line in that php means. Just because I pointed it out it does not mean this is the problem he is getting

pjkcards 05-19-2014 06:59 AM

Quote:

Originally Posted by Zachery (Post 2495593)
You should update MySQL, however, according to that free, you have 1.7gb of free memory, and are only using 700mb.

You should reduce the number of connections though, chances are you don't need 500.

I will update it. However, if that isn't the issue, what is causing all these errors?

Quote:

Originally Posted by Zachery (Post 2495708)
The error is just stating MySQL can't connect, the error lines from the software are pretty pointless.

Why can't it connect?

Thanks for your help, much appreciated.

Zachery 05-19-2014 06:09 PM

Don't know, that error generally emans MySQL is down, or otherwise unreachable.

pjkcards 07-24-2014 03:44 AM

Aside from upgrading, what can be done to resolve this? Getting a lot lately. Thanks.

Zachery 07-24-2014 04:20 AM

Are you running on a dedicated server or shared webhosting?


All times are GMT. The time now is 01:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01238 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete