Getting timeouts | VPS too slow?

Hi together! First of all: My Mail in a box has been running flawlessly for years. It manages about 50 domains with about 120 mailboxes.

For some time now I always get a time-out “Something went wrong, sorry” after logging into the web interface. I get the same time-out when calling the “External DNS” page.

But running sudo ./status_checks.py works fine. I noticed that the CPU of my VPS goes up to 100% when calling the status page from the web interface. So I guess that it just can’t be built fast enough.

Does anyone have experience with this?

Hardware VPS:
2Ghz KVM Shared CPU
8GB RAM
400GB SSD

Edit1: After adding a custom DNS entry i get:

image

After a reload I see that the entry was created though.

CPU Usage while adding custom DNS:
image

1 Like

Hi,

If you time things you will see that the status page times out in exactly 30 (I think) seconds.

The issue is not memory or cpu but rather the timeout setting in nginx. You could increase the setting, but it will be overwritten whenever MiaB updates.

1 Like

Could it be a PHP timeout, and if you change the PHP settings, will it also get overwitten?

Maybe try to resize your box to one that has more CPU than RAM for the same price and use some swap file to give it a bit more memory.

It is definitely a nginx setting, and it definitely will be overwritten. Perhaps a issue could be raised on GitHub to increase the time out. Whether or not it is a PHP related time out setting in nginx, I am not certain.

The python script running the /status page is not PHP and not affected by PHP timeout, Nginx default timeout for proxy to the python script should be 60 seconds.

I checked the ngnix config and it’s not set so it should be using the default timing.

The script runs a couple of tests, and one of them is to run all the dns checks + spam list check, which could be the source of the problem when too many domains exist.

Since MIAB is not designed to be a name server first package, probably try off-loading the domains to a service provider like D/O or Linode? It’s free.

Thank you for clarifying that the time out is 60 seconds rather than 30. I had indicated that I wasn’t sure of the exact timeout.

But regardless, the script is taking longer to run, that the time out which is what causes this issue.

I tried to increase NGINX timeout which only just makes it to take longer to load the status page. It also ends up with the same error. Whether it loads successfully or not seems to be absolutely random.

@pm74 I´ll try to contact my hoster to upgrade my VPS and see what will happen.

Maybe try to increase the PHP session timeout. PHP can timeout if it has too much to work to do.

1 Like

@prostream

You know, I indicated that the problem is likely the nginx timeout, but I had not considered the php session timeout as @pm74 mentions.

You are using your MiaB to manage considerably more domains than I was so it is quite possible that if the two settings are different, then I never would have ran into the problem with the php session timeout that you are facing. Sorry for not considering it as well.

2 Likes

Yes understood that. I just checked it and there seem to be two php.ini’s:

/etc/php/7.2/cli/php.ini
/etc/php/7.2/fpm/php.ini

In which one do I have to change this?

if you are talking about your admin panel, it’s not PHP. It’s ran by mailinabox/management/daemon.py .

There won’t be any use changing your php time out, which is used for your nextcloud and roundcube.

maybe try running mailinabox again?

also make sure you update all your packages, i realise there is a slower loading whenever there are new packages that needs to be installed.

To upgrade all packages

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
1 Like