Fresh install very slow - possibly DNS misconfig or php crashing?

Apologies in advance for noobie questions as this is my first attempt at trying to manage my own server after years of using managed services from ISPs using CPanel, etc.

My hardware is an Intel Xeon E3-1230 with 4 CPUs, 32GB RAM, 2x2TB SATA HDD Raid 1 running Ubuntu 18.04 LTS 64bit. I’ve installed a default Hestia Control Panel v1.3.1, created glue records for ns1 and ns2 with my domain host pointing at my server and created those records in Hestia’s DNS and changed the DNS Zone template to child-ns. All good so far (I think).

But, I’ve noticed after a period of uptime; say 1 day, HestiaCP becomes unusably slow. Like a minute or more between menu options. Also, I can send mail, but not receive it (this may be unrelated, but trying to explain all symptoms for completeness).

My non-expert gut feeling is this may be my misconfiguration of the DNS. It probably started when I chose the hostname originally, as not really knowing what the hostname should be I originally choose cp.domain.tld (domain.tld replaced with my actual domain). I then created a website for domain.tld and after encountering some problems with mail that said the HELO hostname didn’t match I used v-change-sys-hostname to update that to mail.domain.tld. Now I have three websites cp. mail. and the main domain.tld site and one DNS zone for domain.tld that holds the A records for all three, and I’ve added LetsEncrypt SSL for all of them too. Admin is the only user and all three domains appear under that account.

One thing I did notice when the system had gotten really slow, under the server list it was telling my all services had been running for about a day, except php-fpm which had an uptime of 0 minutes. As if php-fpm had kept restarting.

So, have I screwed up my DNS config or some other error? Given the 32GB RAM on the server, should I be changing the config of the services to give them more room to breathe? Is there a log file I should be looking at to figure out why incoming mail isn’t working?

I appreciate your patience with a new user. HestiaCP is certainly way ahead of CPanel in terms of controlability (and a much better UI). Hopefully I’ll be able to get my head around it with your help.

Ok, so quick update. I suddenly starting getting floods of emails from CRON saying it couldn’t resolve my domain, so after Googling possible causes I edited /etc/hosts which originally looked like this:

127.0.0.1	localhost
127.0.1.1	IS-85517

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

to this

127.0.0.1	localhost localhost.localdomain mail.domain.tld
127.0.1.1	IS-85517

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

And now incoming mail works (mail.domain.tld obviously whatever your hostname/domain is). Don’t know yet whether this solves the slow down of the control panel - I guess I’ll have to wait a day to find out.

Hi Pete,

I am not a sysadmin but for what I know. I suspect it has little to do with DNS.

Once your laptop asks for a DNS resolution it will store it and will never ask for a new one in 4 hours or so. So DNS can’t explain that.

If your DNS is misconfigured you would not see the panel or the web or receive emails.
If your PHP had crashed you would be seeing a White Screen Of Death (WSOD) which you are not.

To check your processes you can use the following commands:

  • top: to know the real time cpu consumption of each process
  • ps axu: to identify all processes and their consumptions.

What is the load average values of your server?

Not very high

top - 09:23:22 up 19:15, 0 users, load average: 0.19, 0.08, 0.02
Tasks: 185 total, 1 running, 123 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.7 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 32929988 total, 29563152 free, 1681512 used, 1685324 buff/cache
KiB Swap: 999420 total, 999420 free, 0 used. 30829768 avail Mem

Well, with top on the SSH console, try to reproduce the error. And see if there are any changes.

The load average is:

  • 19% of one CPU in the last minute
  • 8% of one CPU in the last 5 minutes
  • 2% of one CPU in the last 10 minutes

Your server is basically waiting to work.

since you have 4 CPU cores the load seems below minimal. Since it is HDD not ssd some time running disk defragmenter will solve the slowness.

Well I thought I’d bought a 4 CPU core, turns out it’s 8. Bonus!

As this is a completely new machine, I’m a little confused as how a defrag would help? Unless that’s just something that needs to be done.

As of this morning the CP is still running at normal speed, but incoming mails have stopped again. I don’t think I’ve done this much searching on Google for years :wink:

Ok… this confuses me even more. Just used telnet to manually send myself an email (with badly spoofed sender, ie [email protected]) and it came right through. Sending from my mail client, still nothing.

So this maybe a problem outside the scope of these forums, but would appreciate suggestions as to Google search terms so I can do some further research on the mail problem.

Ok. I’m dumb. The email error was because the domain I’m using on the new server was previously with the host I’m sending the test messages from; I hadn’t deleted that old site on that host so obviously it was using the local DNS tables and sending the email to that inbox. Deleted the site from the old host and bingo, email works. Should have thought of that before.

In other news the speed of HestiaCP continues to be pretty snappy, so whatever it was slowing it down might now have resolved itself. I’ll keep an eye on it.

Thanks for everyone’s contributions.

Pete

Happy to help.

Well if the problem is not CPU then maybe disk I/O could be the troublemaker. I don’t think a defrag would help.

0.1 wa Disk is fine in top monitoring

while late, just to add some additional thoughts that might be helpful:

you for sure don’t have any issue with ressources here, tons of ram, full dedicated CPU… you should be able to run quite large websites on that without even thinking about ressources.

while harddisk don’t offer high iops like SSDs this should not worry you, as you don’t need to share it with other on your dedicated. defragmentation is not really a thing in linux, so rather forget about that quickly.
ext4 does not overwrite old deleted content directly but instead continues writing in the empty space until it reaches the end of the disk. so only after you first wrote 2TB in total it will start filling in deleted chunks. that way fragmentation starts very late and usually never really becomes a thing… just saying.

the slowiness of course can be due to a misconfiguration of DNS entries - if something does not resolve properly or ends up in a split brain, you can experience loops or at least timeouts which makes it feel unusable.

hosts entries can be dangerous, because they easily get forgotten :wink: rather have it resolve porperly via external DNS. using ping and/or dig to check the correct dns resolution from multiple different servers can help finding such issues.

and like you already found out, of course an existing setup for a domain as mail host might lead to local delivery instead… :mailbox_with_mail:

2 Likes