Slow first request to web interface

Support for the freeBSD package, created by dbrooks
Post Reply
spec1alk
Newbie
Newbie
Posts: 7
Joined: October 3rd, 2018, 12:58 pm

Slow first request to web interface

Post by spec1alk »

I am running version 2.3.4 [2a113f7] on FreeBSD 11.2 (FreeNAS 11.2 BETA3).

It seems that the first request takes a really long time to load, then subsequent requests take <1 second (usually <100ms). It is almost as if the process that serves the web interface is being put to sleep and has to start when the first request is made. I have a screenshot of the Network tab in the Chrome developer tools that says the "Waiting (TTFB)" is taking 57 seconds.

Is there a way to fix this? Or a log I should be looking at?
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: Slow first request to web interface

Post by jcfp »

what url are you using for that connect? dns issue/timeout?
spec1alk
Newbie
Newbie
Posts: 7
Joined: October 3rd, 2018, 12:58 pm

Re: Slow first request to web interface

Post by spec1alk »

Web interface is accessible via http://usenet:8080/sabnzbd/
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: Slow first request to web interface

Post by sander »

In the Chrome Network tab, you can what takes time ... so what is it? Or is that really TTFB (Time to First Byte)?

What if you access it via it's IP address?

What if you use a different browser?

What is the output of

Code: Select all

time curl -v http://127.0.0.1:8080/ 2>&1 | head -40
User avatar
safihre
Administrator
Administrator
Posts: 5523
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Slow first request to web interface

Post by safihre »

That's crazy slow. Should be like 20ms, not seconds.
Different browers? Is SAB getting enough CPU?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
spec1alk
Newbie
Newbie
Posts: 7
Joined: October 3rd, 2018, 12:58 pm

Re: Slow first request to web interface

Post by spec1alk »

Sorry for the late response. I wasn't seeing the email messages notifying me of updates.
sander wrote: October 3rd, 2018, 11:29 pm In the Chrome Network tab, you can what takes time ... so what is it? Or is that really TTFB (Time to First Byte)?

What if you access it via it's IP address?

What if you use a different browser?

What is the output of

Code: Select all

time curl -v http://127.0.0.1:8080/ 2>&1 | head -40
Yes, it is really TTFB. It acts almost as if the process has gone to sleep and needs to be awakened to serve the page.

I will try with the IP Address, but I typically try to use the hostname as it is easier to remember. It is running in an 'iocage' jail on FreeNAS. I just ran that command from another machine using the IP address and it returned almost immediately. The browser page is also loading immediately right now. I will try to keep an eye on it and attempt to reproduce the delay. I did restart the service recently to apply a configuration change. I forget what exactly I changed, but it required restarting the service. Since then it seems to be much snappier.

I will try a different browser if I see the problem again, but using cURL should identify if the browser is the culprit (if I can't reproduce the problem, its likely the browser. If I can reproduce, then it is likely not the browser).
safihre wrote: October 4th, 2018, 6:34 am That's crazy slow. Should be like 20ms, not seconds.
Different browers? Is SAB getting enough CPU?
It should have enough CPU. I don't know how FreeBSD/FreeNAS and iocage divide processing power, but my server has 2 Xeon processors, with a total of 12 physical cores and 24 virtual cores (hyper-threading). They are 2.0 or 2.2ghz each.

And yes, subsequent loads are <100ms or better.
Post Reply