# Processes after a long time sleep



## tariz (Jul 14, 2015)

Hello all. Does anybody knows that kingd of problem?
freebsdFreeBSD 8.4. lighttpd or any kingd of processes after a long time go to sleep, for example sleep one day or two days. After first connection  to web server it waits almost 10-20 second to connect. Then connections makes very fast. Where should I look to fix it?


----------



## Uniballer (Jul 14, 2015)

Does the system do other things while the web server process is sleeping?  What kind of things?

Are we talking about a system with limited memory where processes that are not running get paged out and need to be paged back in before they can run?  This can take a long time if the disk is really busy doing other stuff.

Are we talking about a system where the pages to be served reside on a disk that is allowed to spin down, and must spin back up before the data can be read?


----------



## tariz (Jul 15, 2015)

System does nothing and is idle 100%. On FreeBSD running 10 lighttpd and 10 catalyst server. On system 16gig ram with no limited memory. Disk is not busy and is doing nothing. No spin down.

Example: Install fresh FreeBSD 8.4, running Lighttpd and Catalyst 10 workers and MySQL 5.5.42. First I start them, it works perfect ultra fast everything. For experiment server run only locally nobody can access from internet to server. I didn't check it when it goes deep sleep but after next day I make connection to the one site, it waits almost 10~20 second. After second connection to the same site works very fast. Then I connect to anther site, same thing, waits 10~20 second and so on. If problem was on HDD on second, third, etc connections everything should be vary fast.

This problem I had notice on my main server.  Maybe system somehow unload from memory but `top` show nothing or MySQL bug?


----------



## tariz (Jul 15, 2015)

OK I'll test site without MySQL server with only Lighttpd and Catalyst. And we will see tomorrow will be lag on connection or not.


----------



## tariz (Jul 16, 2015)

Thanks for all, it was MySQL problem, we will see... )


----------

