Initial request to server extremely slow after longer periods of inactivity

Raimund Sacherer rs at
Fri Apr 10 09:01:49 UTC 2015

----- Original Message ----- 

> From: opendaddy at
> To: "Michael Schuster" <michaelsprivate at>, terje at,
> freebsd-questions at
> Sent: Thursday, April 9, 2015 8:58:00 PM
> Subject: Re: Initial request to server extremely slow after longer periods of
> inactivity

> It's probably not my DNS. From the NSD mailinglist:

> > On 9. april 2015 at 6:49 PM, "Ondřej Surý" <ondrej at> wrote:
> >
> > if you run the daemon in any environment that is resource starved and
> > the process(es) gets swapped than anything will be slow on first request
> > after period of inactivity. Not just NSD and not just any DNS server,
> > but anything...

> I read somewhere that some people use a cron script to send a request to the
> webserver every so often. Is this something that everybody does but that
> I've somehow missed? Does it have a name?

> Thanks!

> O.D.


we have quite a few unix servers around and I am unfamiliar with a cron-setup just to keep some sort of connectivity going. 

First I would check the /etc/resolv.conf, if you want post it. 

Then what I would do in your case is open a few ssh sessions, run top with cpu focus in one, top with IO focus in another and in a third i would take a tcpdump written to a file. Maybe another session with vmstat to check on pagin/pageout, etc. 

Then I'd wait the appropriate amount of time and try a web connection, if it takes long, I'l check the top's if there is something going on (lot's of CPU, lot's of IO, pages etc.) and check the tcpdump in wireshark to see if there are problematic DNS queries which maybe are timing out, etc. 

That should cover the bases ... Maybe you are on some sort of cheap VPS service which has resources severely over-commited and maybe your whole system has to "wake up" ... but this is a very far-fetched scenario. 


More information about the freebsd-questions mailing list