Hi, ok forever is a little exaggerated, but when I click ‘Create Virtual Server’ is takes a full minute or more before I see the page and the form. Why is this, is there something heavy going on in the background?
Edit: ok strange, I tested it on multiple installs and over a period of hours, but now suddenly it works fast most of the time?
It does not check anything outside right? CPU is below 10% during this. Strange, wonder what it is doing for so long. I don’t make new Virtual servers all day long, so 1 minute it not a disaster, but I thought it could point to some problem maybe.
Usually whenever there is a mystery “slow” problem, it comes down to DNS.
For example, trying to get a Let’s Encrypt certificate could take a long time if DNS is not responding fast (first Virtualmin tries to confirm DNS is setup for the domain and it points to the right place, etc. and then LE makes its own requests to validate).
Thanks, there was indeed a problem with a domain that looked DNS related today. I keep an eye on it to see if things speed up again. Currently it is just like 2 seconds again.
Fixed the DNS problem yesterday, but checked today and the Create Virtual Server takes forever again. Nobody else got this problem? You don’t have to create a new server, just click ‘Create Virtual Server’’ in your menu to see how long it takes to load the page.
Of nobody else experience this, I guess it is a low prio thing and I will stumble on the cause sooner or later.
It’s pretty unlikely to be load-related, unless everything else on the system is showing sluggishness. Virtual server creation isn’t a CPU-intensive job. It’s mostly editing text files, restarting services, and looking up some stuff.
It’s unusual for it to be very slow, but when it is it’s almost always DNS. But, since you’re saying DNS is fixed, we’ll need to dig deeper.
To troubleshoot further, you might try watching the actions log in /var/webmin/webmin.log (just tail it with tail -f /var/webmin/webmin.log while performing a virtual server creation), and see what the actions just before and just after the GUI “hangs” for a bit. That may give you (or us) some clues about what could be slowing it down.
If you have any pre or post change scripts, they can also do surprising things; e.g. if they make any web requests, call any APIs, or otherwise can hang for a long time, they can cause Virtualmin to wait for completion.
Thanks for giving me some direction here to debug this. But there was nothing useful for this case in the log, only some things about the backups and such.
I realize that it could not be the DNS problem, since the issues was the same on a second server.
I checked out the domain_form.cgi, and I am not into CGI to be honest, but it is well written and see there are quite some checks and loops that could cause this. I’m just curious to solve this puzzle and see if it is just on my side or some small bug.
I think I will install a profiler and as soon it becomes very slow again, I check out what is the cause .
p.s. I clarified the topic title, since it suggested it was during creating of a virtual server, and I am talking about just loading the page when clicked in the menu.
Was there nothing in the actions log? If you want to post the events that occur just before it hangs and just after, I may be able to spot something you’re not seeing, just because I know what code various actions touch and where they might be delayed by something broken.
No nothing in there, just about package updates and backups. But I don’t think it logs anything when you only click on a page in the menu right? Should it?
No, loading a page doesn’t create an event (only an access log entry).
But, I’m shocked. All this time I thought we were talking about the actual domain creation being slow, but you’re saying just loading the Create Virtual Server page is slow? (Looking at the title I see that’s been the case all along, and my brain simply didn’t process it that way because it seems impossible.)
In that case, troubleshooting is different. Try these two things:
Open Web Developer Tools (or whatever it’s called in your browser) and look at the network tab. See what’s loading and which fetch is making it slow (if it’s a fetch making it slow, could also be some JavaScript thing going nuts).
Try changing your theme temporarily to Framed Theme, and see if it is slow there.
Those two things will help narrow down where things are going wrong (whether in the theme or something in Webmin/Virtualmin).
I just tried this on my pro server and it did take a minute or so to load. I checked with top and the load was low 0.15. The red line was sliding back and forth across the top as when doing eg Refresh Packages etc.
Subsequent attempts have all been fast as expected, so it was only slow the first time.
I would expect about two to three seconds. I can’t imagine how it could take a minute, unless there are pathological disk performance issues or low memory and swapping is taking place.
I’m sorry about that! I did realize later that the title was misleading and edited it. Because I had in the first line of the OP:
Which is no criticism, because I understand with so many posts you ‘scan’ things and not read it all, all the time.
So, sorry about that, lets continue
The stats.cgi is loading 13 times, but this happens on all the pages.
The domain_form.cgi page that took 28 seconds to load according to my network tab.
And:
Like Randomz, it seems to occur the ‘first time’ after that it is fast again.
No I did not see this behavior on any other page so far
Changed (on the second server) in framed theme first than clicked the Create Virtual Server page again, I did not see any loading time. But I will try a few times over the day to be sure.
stats.cgi loads every second to keep the graphs in the right pane updated, I believe, but it shouldn’t prevent page display, it’s dynamically loaded after the page is already going. You should already see the page before stats.cgi starts repeating.
For anyone seeing Create Virtual Server page load slow, go to System Settings ⇾ Virtualmin Virtual Servers ⇾ Configuration: Networking settings page and set Default IP address for DNS records option to Other address, with an actual public IP address.