Critical error: Could not connect to database-server (when authenticating) (Too many connections)

Post

Posted
Rating:
#5064 (In Topic #1137)
Avatar
Standard member
ironfeather is in the usergroup ‘Well-settled’

Critical error – bailing out

Hello,
 

Critical error – bailing out

Could not connect to database-server (when authenticating) (Too many connections)

It seems like once a month I get this and the system is down for a few hours. I am waiting for it to come back now, fingers crossed.

Honestly I think it the server I am using and not a problem with Composr.

I am running other composr sites on different servers and this has never happened.

The server this is on is hosted by a friend, he is giving me some space on a server that is also hosting other people so my guess is it is maxed out.

My new goal is to migrate my site to a different server.

Anyone else run into this problem?


php - "Could not connect. Too many connections" Error in MySQLi - Stack Overflow

I am going to "… increase the number of connections to your MySQL server…" and see if that helps

 

———–
Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:  Nandalow.com
Composr site for my freelance work: Futurecode.jp
My Compsr edits : 
http://ironfeather.com/bbs/viewtopic.php?f=12&t=2862
Twitter: https://twitter.com/futurecodejp

 
Online now: No Back to the top

Post

Posted
Rating:
#5065
Avatar
Standard member
ironfeather is in the usergroup ‘Well-settled’
update: 
I can't even login via shell so its a server problem for sure

 

———–
Publisher of IronFeather Journal since 1987.  Host of KGNU Colorado Radio for 20 years. 
Currently in Japan & decided to focus on Composr as my number one CMS.
Composr site for community of Hokkaido:  Nandalow.com
Composr site for my freelance work: Futurecode.jp
My Compsr edits : 
http://ironfeather.com/bbs/viewtopic.php?f=12&t=2862
Twitter: https://twitter.com/futurecodejp

 
Online now: No Back to the top

Post

Posted
Rating:
#5066
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Right, in this kind of situation a server admin needs to look at what is consuming the system resources.

Often some kind of system slow-down will backup web requests, causing limited resources (like the MySQL connection pool) to max out.

It could be bot activity, for example.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by enelson)
#5067
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
I wanted to write some more up about this, as over the years I've had to develop expertise in managing servers, and I never really found a good resource summarising how to do it well. I'm not sure it's directly relevant to you, as it's not your own server, but hopefully it will help someone (it's also going in our performance tutorial)…


If you are administrating a server you could come across situations where the server 'grinds to a halt', or spits out depleted resources messages. This isn't a Composr problem, but just like any desktop computer can take on too much work, so can a server.

In these kinds of situations you need to identify what server resource is depleted. Typically it is either:
  1. Disk I/O
  2. Memory
  3. CPU
  4. Network I/O (available bandwidth)

There are are various commands on Linux that are useful during diagnosis…
Command Purpose Hints
uptime Show the CPU load at different points in time If the load level is higher than the number of CPU cores in the server, you have a serious issue.
ps -Af Show all active tasks This will show you if you have a run-away number of processes (e.g. dozens of Apache instances).
top -n1 Show active processes, sorted by CPU usage; also, total CPU usage, memory usage, and I/O wait time This will tell you what processes are using a lot of CPU or memory (press M to sort by memory), as well as giving you good clues to what resource is primarily depleted.
iostat Show CPU and disk load This is useful to find disk I/O load.
iotop Show active processes by I/O load This command usually is not installed by default. It is very useful to find what processes are doing a lot of I/O.

Additionally, the Apache web server has mod_status which can be configured to show what web requests are coming in, and how long they last for. This tells you a lot more than the Apache log will.

There is an 'art' to finding the cause of a performance slow-down. Often just one depleted resource will have a knock-on effect on others. For example, if I/O is saturated, memory may become depleted as Apache processes back up.

A skilled system administrator will:
  1. Stay on top of performance metrics, to know what needs optimising or where to spend more on hardware
  2. Develop experience isolating the cause of slow-downs, pointing to programmers where they need to do profiling and optimisation
  3. Configure a server so that excess activity results in appropriate error messages, rather than a crashed server (for example, by configuring the Apache settings to limit the number of processes and threads to what the server can actually handle)


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,052 topics, 7,195 posts, 10,827 members
  • Our newest member is LowfareMart
Back to Top