![]() |
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 |
"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:
|
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"? |
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 |
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?
|
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. |
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 |
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 |
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.
|
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 |
Too many connections is separate from the query issue.
You can read about the datastore cache here in the manual - The vBulletin Datastore |
thanks
--------------- Added [DATE]1325748986[/DATE] at [TIME]1325748986[/TIME] --------------- Update: IX gives me 50 connections, its a shared server. They suggested Throttle Policy, set 30/15sec, which I did (their 2nd suggestion to deny whole countries. The attack still occurred. I can live with this, it started a month ago, why I don't know, but I think/hope that it will someday move on, when they accomplish nothing. If you happen to think of something, please let me know Thanks for your help. |
Update, Tonight at 10:15 I turned off the site, at 10:19 the "too many connections" emails started?
This isn't what I expected, any suggestions? Thanks |
People are coming to the site even though it is off.
Have you looked at your access_logs to see what pages they are hitting at the time you get the error? |
Sounds like spiders are hitting the site hard.
|
Get CloudFlare. Set security to medium, then disallow China.
The attacks would then hit CloudFlare and not you, and as a CDN, CF will also speed up your load times.. You can add any country, or any custom IP ranges in your CF settings. |
Lynne, The pages are random, just post/threads in the forum
Boofo, any other solution that you feel will work? Max, I looked at CF and see there is a free one, do you just sign up and you or they apply it to the forum root? Thanks for your help. |
Quote:
https://vborg.vbsupport.ru/showthread.php?t=259173 |
Max, I read all of the info, from the other forum/s and it looks like a solution. Did you have any issues? I see where you change the db in the config file and I tested the FTP change, what is the other change that you need to make that they talk about. Is the DNS the actual db "location"?
Lynne, have you seen any issues with CF? Apparently, they have some working relationship with many host, but I didn't see IX in their list. Thanks again for every ones help |
Quote:
I have had zero problems with CF and it's been great to have. You are not editing the config file, you edit class_core.php like this: Code:
1. open includes/class_core.php |
Thanks again Max, where do you "assign my domains"?
Do you use the challenge page? |
Quote:
I just use the default page, I didn't customize it. But, there's option to do so. "assign the domain" means, CF will give you new nameservers to assign to your domain, through your host instead of the nameservers you have now. |
Thanks max, I guess, I'll give it shot tomorrow.
|
It sounds a lot more confusing than it really is once you get going on it, trust me. Max is the man to go to for any advice. ;)
|
Quote:
|
Max, Do I use my main domain to register with CF, or just the forum's subdomain?
i.e. mydomain.com or forum.mydomain.com Thanks |
Quote:
|
Thanks again Max for your time.
I'm in the process now of setting it up and I'm at the point that it shows what will be protected/routed to them, and while the main domain and the forum domain have the orange cloud the actual NS (DNS) has the grey cloud. Did I screw something up? |
Quote:
|
Thanks again Max. Ok, I finally got that step completed (CF said that the NS shouldn't be routed that way, KEEP grey clouds.
I have changed the DNS servers at IX, "wait 24 hours" When do I change the code in class_core? When this "flips" will my site be down until I make that code change? I went to the class_core.php file and (3.8.4 patch 1) it doesn't have those lines of code to replace |
Quote:
The change is needed so IPs of you, members and visitors won't all be resolving to cloud flare in online.php and elsewhere on the board. |
1 Attachment(s)
ok, Thanks again for your help.
|
This is the file out of /includes folder?
??? includes/class_core.php is the file needed editing. Per here: http://www.cloudflare.com/wiki/VBulletin_3.8.4 |
Yes, Max that is what I have there, and I double checked and that's what is on the site.
I looked at the files on 3.8.6 that I didn't put up, and it also doesn't have those lines. Ok, I figured it out, its broken up so find replace doesn't catch it. line 2257 Thanks again for your time and energy. |
Quote:
PHP Code:
|
Max, you also might want to tell them about the the other option of installing mod_cloudflare on the server if they are using Apache to avoid the file edits.
|
Quote:
|
I just had my host install it. Never had to touch anything. ;)
|
Thanks again, I trust that I have it right. I guess, I made the "spiders" mad, yesterday they attacked at 6:30 in the AM and about 6:30 in the PM. Today they didn't do that.
|
Quote:
|
All times are GMT. The time now is 02:15 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|