Page 1 of 1

Slow first request to web interface

Posted: October 3rd, 2018, 1:05 pm
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?

Re: Slow first request to web interface

Posted: October 3rd, 2018, 2:39 pm
by jcfp
what url are you using for that connect? dns issue/timeout?

Re: Slow first request to web interface

Posted: October 3rd, 2018, 7:58 pm
by spec1alk
Web interface is accessible via http://usenet:8080/sabnzbd/

Re: Slow first request to web interface

Posted: October 3rd, 2018, 11:29 pm
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

Re: Slow first request to web interface

Posted: October 4th, 2018, 6:34 am
by safihre
That's crazy slow. Should be like 20ms, not seconds.
Different browers? Is SAB getting enough CPU?

Re: Slow first request to web interface

Posted: October 4th, 2018, 6:20 pm
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.