Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2016, 08:40 AM
fresset fresset is offline
 
Join Date: Sep 2016
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Opened MySQL connections on vB 3.8.4

Hello there,
I have a problem in my vB installation which creates connections that won't close.

Let me explain. I log in into phpmyadmin and run "show status like '%conn%';" and see 800.000 connections. After 1 minute, these connections may be 801.000, and so on.

My host found an attack before some days and restarted MySQL, so this number started from 0 and now, after 6 days this number is 800.000+.

My host told me that there are somewhere code lines that open a connection with MySQL and they never close it.
I have about 5.000 php files in forum's installation and I have no idea how to check this.

Sorry for my english. I wish I explained the situation properly.

Thank you
Reply With Quote
  #2  
Old 10-03-2016, 09:05 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is nothing in default vBulletin that does that.
Its possible (but highly unlikely) you have some other software or addons.

MySQL should close its own connections anyway if they are unused, sounds like your host has a very large value for "wait_timeout", it only needs to be about 120 - 180 for vbulletin, I've been using 180 for 10+ years, without any issues.
Reply With Quote
  #3  
Old 10-03-2016, 10:42 AM
fresset fresset is offline
 
Join Date: Sep 2016
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Paul M,

Thank you for your reply.

I don't think that is a server problem, although I can discuss it with my host.

I have many addons installed, and I could disable all and enable one by one to see if the problem is still there. But I have about 15.000 people online all day, and this will make a problem to my users. If there is not any other way, I will try it, but as a last solution.

Something that I forgot to say is that I am taking an error by email in default forum's email which refers to class_core.php on line 1206, but file seems to be fine.

Error is here:

Code:
mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
/var/www/html/includes/class_core.php on line 1206
Any idea?
Reply With Quote
  #4  
Old 10-03-2016, 12:14 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That message means php could not connect to the mysql server at all.
Reply With Quote
  #5  
Old 10-03-2016, 01:28 PM
fresset fresset is offline
 
Join Date: Sep 2016
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.. A colleague show me this email but didn't defined the date. It was under an SQL restart.. I am sorry.

Anyway, no solution until now for the connections.
I wish I can find something, and I will post it here.

Thank you again for your time.
Reply With Quote
  #6  
Old 10-03-2016, 04:32 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're probably reading it wrong. I'm not quite sure, but your post surely implies that. What I'm wondering: Your host really should know that...
Code:
show status like '%conn%';
Returns something like this (shortened):
Code:
Connections
4473207
Max_used_connections
33
Threads_connected
4
The value for "connections" is the number of all connections opened to the mysql server, as in: ever, for all times (or, more exact: since the last mysql server restart). This is not the number of sessions currently open. So, the 800.000 connections would be all connections ever opened since restart, but this does not give any information on how many of those connections were closed succesfully. And of course this number is increasing.

The connections currently open would show under "threads connected". See the example? That's over 4 million connections opened since last restart, but currently there's only 4 connections open.
Of greater interest would probably be the all time high of connections open at the same time under "max_used_connections" - in this case 33.

See: http://dev.mysql.com/doc/refman/5.7/...variables.html

And yes, this server is running vB3.
Reply With Quote
  #7  
Old 10-05-2016, 08:06 AM
fresset fresset is offline
 
Join Date: Sep 2016
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello cellarius,
Thank you for your reply.

The problem occurred when we made a SQL restart and connections increased to 65.000 in the first 30 minutes, when visitors where less than 1.000 that certain time.

Anyway, my host informed me that there were some mass connections which where blocked. So there is no problem now. Instead of telling me this at the start of the problem, he talked to me about not closing sql inside my code.

Everything is ok now.

Thank you all!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05915 seconds
  • Memory Usage 2,217KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete