Critical error: Could not connect to database-server (when authenticating) (Too many connections)
Posted
#5064
(In Topic #1137)

Standard member

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
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
Posted

Standard member

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
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
Posted

Site director

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
- 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.
Posted

Site director

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:
- Disk I/O
- Memory
- CPU
- 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:
- Stay on top of performance metrics, to know what needs optimising or where to spend more on hardware
- Develop experience isolating the cause of slow-downs, pointing to programmers where they need to do profiling and optimisation
- 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
- 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.
1 guest and 0 members have just viewed this.