Page 1 of 1

Web server up and down, up and down

Posted: Wed 29. May 2024, 21:04
by gacott
I'm sure the cause of the problem is within KeyHelp

This is happening with the websites on the server, and the server front end as well


Server operating system + version
Debian 12


Server virtualization technology used
Bare Metal


KeyHelp version + build number
Latest Version, everything updated

Problem description / error messages

For about 18 hours now, the websites on the machine have been going up and down/ The server front end has the same issue. This machine is behind NginX Manager, but has been for over a year; all of a sudden, all of the sikes keep going up and down.


Expected result


Actual result


Steps to reproduce


Additional information
I ran updates AFTER this behavior on the machine, rebooted, and it is still happening. Offline for about 1 minute at a time, then 5 one, then one-off.

Is there an easy way to move accounts/sites etc to another server?


(e.g. recent changes to the server, excerpts from log files (/var/log/*, /var/log/keyhelp/php-error.log, etc.))

I am seeing some of this: [29-May-2024 08:43:38 America/Chicago] PHP Notice: DB-Connection timed out, now reconnecting... in /home/keyhelp/www/keyhelp/core/pending/DBConnection.php on line 178

Re: Web server up and down, up and down

Posted: Thu 30. May 2024, 00:46
by gacott
Just to update, it's getting worse and worse, the sites are down about 2/3 of the time. I am trying to pull backups, but it's going down so much it's almost impossible,

Re: Web server up and down, up and down

Posted: Thu 30. May 2024, 09:42
by Alexander
PHP Notice: DB-Connection timed out, now reconnecting... in /home/keyhelp/www/keyhelp/core/pending/DBConnection.php on line 178
This is not really the cause, as this is only an indication that the database has been reconnected during long-running tasks. This is quite normal behavior.

You have to provide logs of the components which are down.
What means "down" in your case? Which error messages show up.
How do the logs of the services look like PHP-FPM / webserver / syslog etc.

Re: Web server up and down, up and down

Posted: Thu 6. Jun 2024, 14:59
by BasHeijermans
Looks to me you need to increase the database buffers to keep up with the tasks.
If the buffers are too little the database will give problems.
Or the number of connections is too low.

Then it's not down, it's just the database is busy and as such it takes too long to respond.

You may want to tune the database.

Re: Web server up and down, up and down

Posted: Sat 17. Aug 2024, 14:48
by gacott
BasHeijermans wrote: Thu 6. Jun 2024, 14:59 Looks to me you need to increase the database buffers to keep up with the tasks.
If the buffers are too little the database will give problems.
Or the number of connections is too low.

Then it's not down, it's just the database is busy and as such it takes too long to respond.

You may want to tune the database.
Thanks, how would one tune the database in this case then?

Re: Web server up and down, up and down

Posted: Sat 17. Aug 2024, 15:06
by BasHeijermans
Change the settings in for /etc/mysql/mariadb.conf.d/90-tuning.cnf

Especially the key_buffer_size is important, when it's too small it won't buffer and read everything from the harddisk and thus slows down to a crawl.

Typical these are set for small databases, not for big ones.

Plenty websites to find on tuning the database...but beware, it can eat memory too and swapping isn't good either.

All depends on the ammount of ram you have.

Re: Web server up and down, up and down

Posted: Sun 18. Aug 2024, 13:28
by gacott
BasHeijermans wrote: Sat 17. Aug 2024, 15:06 Change the settings in for /etc/mysql/mariadb.conf.d/90-tuning.cnf

Especially the key_buffer_size is important, when it's too small it won't buffer and read everything from the harddisk and thus slows down to a crawl.

Typical these are set for small databases, not for big ones.

Plenty websites to find on tuning the database...but beware, it can eat memory too and swapping isn't good either.

All depends on the ammount of ram you have.
Okay, thanks a TON. Yes, we are running WordPress exclusively, and these boxes have 256 GB of RAM, so there should be plenty. And these WP sites are running large DBs as well, they actually are HUGE sites, I think that's where we are getting our issues. I found this site, https://releem.com/blog/web-application ... c602721935 I think I'll take a crack at it.

Re: Web server up and down, up and down  [SOLVED]

Posted: Sun 18. Aug 2024, 13:48
by BasHeijermans
Or use a tool to help you configure:

https://github.com/major/MySQLTuner-perl

It will tell you what you need to do, after that it's just adjusting to what 'feels' good :D

Re: Web server up and down, up and down

Posted: Sun 18. Aug 2024, 23:33
by gacott
BasHeijermans wrote: Sun 18. Aug 2024, 13:48 Or use a tool to help you configure:

https://github.com/major/MySQLTuner-perl

It will tell you what you need to do, after that it's just adjusting to what 'feels' good :D
NIce, thank you! I assume we are meeting the MySQL password somewhere we can read from?

Re: Web server up and down, up and down

Posted: Mon 19. Aug 2024, 12:06
by BasHeijermans
You need the rootpassword of the database, should be stored in a file in the /root directory if I'm not mistaken.
During install it was given to you, and stored in the file if you didn't delete it.

Re: Web server up and down, up and down

Posted: Mon 19. Aug 2024, 13:57
by gacott
BasHeijermans wrote: Mon 19. Aug 2024, 12:06 You need the rootpassword of the database, should be stored in a file in the /root directory if I'm not mistaken.
During install it was given to you, and stored in the file if you didn't delete it.
Thanks, I have gotten though most of it and server response time are half of what they were, HUGE improvement!
One last thing, just not sure of how to do

Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=ON

Where would I change this? And just to 127.0.0.1?
Thanks

Re: Web server up and down, up and down

Posted: Mon 19. Aug 2024, 18:44
by BasHeijermans
I will send you my invoice in a few days :D

You can select IP's that you want to use in the config-screen, but you can not assign an ip to a domein, you have to do that in your DNS.
But why do you want this? 1 IP can handle as many domains as you like, the server will know what is what.

There is NO need to have multiple IP's or subnets per server, 1 IP (1 IPv4 and/or 1 IPv6) is enough to handle any domain on your server.

Do not go there, it has no use. See it like a street-address where you have 1 number, but multiple inhabitants (domains) based on the name of the inhabitant (domain) the server will handle all trafic for that person.

Having more IP's will only waste IP's and does nothing. Ergo, use 1 IPv4 + 1 IPv6 per server, not more, it has no use to use more.

Re: Web server up and down, up and down

Posted: Mon 19. Aug 2024, 20:42
by gacott
BasHeijermans wrote: Mon 19. Aug 2024, 18:44 I will send you my invoice in a few days :D

You can select IP's that you want to use in the config-screen, but you can not assign an ip to a domein, you have to do that in your DNS.
But why do you want this? 1 IP can handle as many domains as you like, the server will know what is what.

There is NO need to have multiple IP's or subnets per server, 1 IP (1 IPv4 and/or 1 IPv6) is enough to handle any domain on your server.

Do not go there, it has no use. See it like a street-address where you have 1 number, but multiple inhabitants (domains) based on the name of the inhabitant (domain) the server will handle all trafic for that person.

Having more IP's will only waste IP's and does nothing. Ergo, use 1 IPv4 + 1 IPv6 per server, not more, it has no use to use more.
No, 100%. I am definitely NOT trying to set up multiple IPs, I am trying to get rid of the look-up. This relates to the DB, nothing else. For some reason, it's doing a look-up to hit the DB; I need to change this to everything just hits 127.0.0.1.