TIPS Narrowed down delay issue on Dashboard access but can use some help to fix it

Halea

Well-Known Member
Joined
Aug 12, 2016
Messages
1,164
Reaction score
917
This is an Incredible PBX 2021 15.0.17.24.1 instance running on a VPS which works well except for an annoying delay on the Dashboard page.

When the Dashboard is accessed or refreshed the product branding banner shows up immediately, the progress bar quickly moves to 80% and seems to be stuck there for about 30 to 45 seconds, after which time the page is loaded with all the info sections.

Through trial and error I discovered that it's actually the "overview" section which is causing the delay.

Then I studied the php script in /var/www/html/admin/modules/dashboard/sections/Overview.class.php and found out the code bloc which seems to be the culprit.
It's the following instruction, which is part of the getSummary() public function:
/* foreach (array_keys($svcs) as $svc) { if (!method_exists($this, "check$svc")) { $final[$i]['type'] = 'unknown'; $final[$i]['tooltip'] = "Function check$svc doesn't exist!"; } else { $func = "check$svc"; $final[$i] = $this->$func($sysinfo); } $final[$i]['title'] = $svcs[$svc]; $i++; } */

When I comment out that portion the Dashboard page loads and refreshes at lightening speed! All the info sections work properly, except for "System Overview" which only loads partially (the Summary box is mostly incomplete).

I'm having difficulties figuring out how the above code exactly works.
This gotta be calling something in the system which takes its time before returning back the expected data.

As a side-note, I've observed this issue both on Debian and Ubuntu deployments, whether the host was bare-metal, a VPS, or VirtualBox. On the other hand, since I don't see anyone else complaining about something like this on the forum, I am even more puzzled.

Thanks for any help.
 
Last edited:
I have a much older system, but in Advanced Settings I had to remove RSS Feeds. YMMV...
 
I have a much older system, but in Advanced Settings I had to remove RSS Feeds. YMMV...
I should have mentioned! Yes, I too got the RSS feeds removed from Advanced Settings. So that section doesn't even show up on the Dashboard any longer.
 
When I comment out that portion the Dashboard page loads and refreshes at lightening speed!
Well now - that also helps on the Incredible PBX 2020.3 for Raspberry Pi;
Raspbian 10 buster; Asterisk 16.16.0 Incredible GUI 15.0.12.46

Maybe you could try commenting out the arrays one by one as on line numbers:-

Maybe you could uncomment the above block and try commenting out the arrays one by one as on line numbers:-
PHP:
135                         "asterisk" => _("Asterisk"),
136                        "mysql" => _("MySQL"),
137                        "apache" => _("Web Server"),
138                        "mailq" => _("Mail Queue"),
 
Last edited:
@Halea I edited my post above
It's a good idea. I'll give a try.
I didn't do it originally because since eventually I got all of them with the green checkmark next to them I assumed that they were all ok.
 
Last edited:
@ostridge : That's it! Zap the "mailq ..." line and everything looks good! No need to disable any other code.
Now I need to figure out why that's slowing down the access. Because eventually it comes back with a green check-mark, so I guess the email related bits are available and all active.
Maybe it's the setup/initialization which is not properly done...
 
Do you have an FQDN specified in /etc/hosts? Could it be the chmod 777 issue?
 
Do you have an FQDN specified in /etc/hosts? Could it be the chmod 777 issue?
Yes, both FQDN and access permissions are correct. But something is not right with SendMail. When I manually send emails they bounce back with a strange header. It looks like SendMail is trying to use something.dyndns.com as a smarthost while it's also showing gmail.com related stuff.
I used the gmail smarthost enablement script and everything seemed to go fine when I originally installed it, but I never really tested emailing until now.
 
I used the gmail smarthost enablement script and everything seemed to go fine when I originally installed it, but I never really tested emailing until now.
Its time you did the sendmail setup again - the instructions will be on the wiki
I presume the script you mentioned is
Bash:
/root/enable-gmail-smarthost-for-sendmail
If that is the one on your server.

See also Reconfiguring SendMail for SmartHosts
 
Last edited:
Hate to say it but there appear to be a few systems on which SendMail just does flaky stuff. In the past week, I installed everything the usual way and the Gmail SmartHost just wouldn't install regardless of the Gmail account. The next day on a different VPS everything worked as usual. No idea whether this is a Gmail quirk (likely) or something weird about SendMail. Might want to try using the Google Reset procedure?
 
Last edited:
Closure to this issue:

The delay on the Dashboard is definitely because of sendmail not properly being installed or configured.

In my case above, it was installed and configured by the PBX installation script. The "/etc/hosts" file was properly made with FQDN and with the proper access rights ("chmod 777"). But, command line email sending attempts all failed because of some obscure configuration issue (which might have been caused at original installation time or when later I tried to run the script to enable a smarthost for transfer intermediary).

I finally got sendmail completely removed and purged (with "apt remove --purge sendmail", then deletion of all "/etc/mail" leftovers, and possibly some other artifacts that I can't remember about).
Then I manually installed it back and configured it in its most basic form to get it to work (although the mail that it sends out is rejected by many big-name email providers for so-called "spam avoidance"). I'll look into setting it up with a smarthost at a later time. But with this much the delay problem on the Dashboard is completely eliminated.

Now, for those who don't care about the emailing feature checks (like me most of the time), a very helpful solution is to edit (with nano for instance) the file "/var/www/html/admin/modules/dashboard/sections/Overview.class.php" on the PBX and place double slash characters at the beginning of the line where it reads " "mailq" => _("Mail Queue"), " to comment out or disable the mail-queue checking. It doesn't mean that the mail function won't work any longer, it simply means that it won't be checked through the dashboard every time you go to the status page or refresh it.

Thanks to @ostridge and @wardmundy for their suggestions.
 
Last edited:
FWIW there is a check for sendmail (or exim) as appropriate in the CLI on login. when it runs /usr/local/sbin/pbxstatus
a line similar to:
Bash:
/usr/local/sbin/pbxstatus
 test=`ps aux | grep -c sendmail`
returns 2 if sendmail is running, or <2 when sendmail $DN
 
Yes, both FQDN and access permissions are correct. But something is not right with SendMail. When I manually send emails they bounce back with a strange header. It looks like SendMail is trying to use something.dyndns.com as a smarthost while it's also showing gmail.com related stuff.
I used the gmail smarthost enablement script and everything seemed to go fine when I originally installed it, but I never really tested emailing until now.

I always pull sendmail off and put on Postfix. It gives much better logging information when there is an issue.
 
I always pull sendmail off and put on Postfix. It gives much better logging information when there is an issue.
I'm planning on installing a stripped-down (from any legacy BBS functionality) version of Citadelmail (https://www.citadel.org/) which is my favorite for all-in-one basic email server functionality.
 
Looks like a nice application to put on.
It is and it's full featured and reasonably easy to set it up and use. Which I just finished doing.

It installed fine without breaking the PBX, but it uninstalled the sendmail.
The "mailutils" package is still there but it can't send out mail since it's no longer interfaced to sendmail.
It gotta be a way I can reconfigure it so that it uses citadel mail as its MTA.

I'm assuming that the PBX is using the "mail" command to send out its emails but I am not even sure about that. If that's the case, and if I get mail to work with citadel then I'm home free!

You mentioned that you replaced sendmail with postfix. How did you configure the PBX to use postfix instead of sendmail (or mail)?
 
We've also had good luck replacing SendMail with Exim4 and not breaking anything.
 
Here's the quick exim4 install and setup on IncrediblePBX2021. This removes SendMail automatically.
Code:
apt-get update
apt-get install exim4-daemon-light
# using server's actual IP addrress, configure FQDN for your server, e.g. 22.33.44.55 mail.incrediblepbx.com
echo "22.33.44.55  mail.incrediblepbx.com" >> /etc/hosts
echo "mail.incrediblepbx.com" > /etc/hostname
hostname mail.incrediblepbx.com
dpkg-reconfigure exim4-config
# choose internet site if your FQDN and reverse DNS are set up
# otherwise choose mail sent by smarthost and enter Gmail (or other) credentials
systemctl restart exim4
 
Last edited:
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top