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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-01-2012, 05:57 PM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Too many connections

Recently I have started getting this database error email. It starts at 10:30PM and last about 20-30 minutes after which all is normal.

This is the first of the error:

Database error in vBulletin :

mysql_connect(): Too many connections
/hsphere/local/home/xxxxxxxx/forum.autocareforum.com/includes/class_core.php on line 311

The ip is from China 180.76.5.64

Night before last the host terminated service and this was one of the issues:

->Query summary
Time: 24% (3696 sec) Amount: 20% (31 queries) Rows Examined/Sent: 557 / 502 Avg. Query Exec/Lock Time: 119 / 43 sec.
Used databases: [pitzerw_vb]
Query example: use pitzerw_vb; SELECT * FROM datastore WHERE title IN ('','options','bitfields','attachmentcache','forum cache','usergroupcache','style cache','languagecache','products','pluginlist','cr on','profilefield','loadcache' ,'noticecache','bbcodecache');
|id table rows Extra
|1 datastore 15 Using where

They turned it back on 7 hours later and suggested that it was an optimization issue, so I ran repair and optimization and it said all was fine.

I am running 3.8.4 patch 2

Thanks
Reply With Quote
  #2  
Old 01-01-2012, 06:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"Too many connections" means the server has maxed out the number of MySQL connections it allows. You can try turning persistent connections off by adding this to your config.php:
PHP Code:
$config['MasterServer']['usepconnect'] = 0
But, if you still have the problem you will have to talk to your host about raising that limit. Also, see this Common MySQL Error Messages
Reply With Quote
  #3  
Old 01-01-2012, 07:14 PM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I'll give it a try.

--------------- Added [DATE]1325485530[/DATE] at [TIME]1325485530[/TIME] ---------------

Lynne, That didn't solve it. What's with the "attack" at 10:18 PST each day.

Any other options?

Thanks

--------------- Added [DATE]1325530072[/DATE] at [TIME]1325530072[/TIME] ---------------

Is there a way to put their IP somewhere that would stop them on the "outside"?
Reply With Quote
  #4  
Old 01-03-2012, 05:59 AM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is what I got from my host:

Our administration team is monitoring network 24/7 and we block external addresses if we detect abusive activity however if someone is overloading your site using some script from your side which generates too many SQL queries it can be very hard to detect because that address does not generate too much traffic. We recommend rechecking your scripts to prevent that from your side. Our administration team told us that it is possible that someone is abusing your application if the problem occurs at exact same time every day but we don't have any evidence of that, please check your HTTP connection logs available inside /logs/ folder in your hosting plan. You can add any address to deny list in .htaccess file, here are some examples:
http://www.htaccess-guide.com/deny-v...by-ip-address/


I added this to my root directory of the forum:

order allow,deny
deny from 213.186.12.
deny from 180.76.6.
allow from all

Do you think that this is the solution or a possible solution?

Thanks
Reply With Quote
  #5  
Old 01-03-2012, 03:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know if that will work (and actually doubt it). I am guessing the host has the max_connections set low for you - did you ask them what it is set to?
Reply With Quote
  #6  
Old 01-04-2012, 06:39 AM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update, well, it happened again but the 2 IPs that I put in the .htaccess were not the same, of course, there were about 10 from the normal unwanted places. The host says" that this is from a "script" on my end". Any idea what they are talking about, or a solution.

I asked about the number of connections, no answer yet.
Reply With Quote
  #7  
Old 01-04-2012, 06:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Of course it's from a script. If you had no pages on your site, then you would never get any errors!

Like I asked before, what do they have your max_connections set to?

You may want to see this - List of questions a user should ask a new host
Reply With Quote
  #8  
Old 01-04-2012, 06:23 PM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still waiting for their answer on the number of connections. My question is if this "too many connections" issue cause the long Query times, which is what they terminated service over?

Is there some way to automatically turn off my site from 10:18 to 10:40 or would that really help. Would they just adjust their "script".

Thanks
Reply With Quote
  #9  
Old 01-04-2012, 08:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may want to see if they have any sort of caching available to you. You could use the vbulletin datastore_cache (set in the config.php file) and see if that helps.
Reply With Quote
  #10  
Old 01-04-2012, 08:43 PM
pitzerwm pitzerwm is offline
 
Join Date: Aug 2007
Location: WA state
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Can you give me the code that would go in the config file? When I put something in the config file, do I need to cycle/reboot something or is it read constantly?

Do you think that these "too many connection" events is causing the Query time issues?

Bill
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 01:46 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.04408 seconds
  • Memory Usage 2,273KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete