Long response times after some idle-hours
Asked by David Thielheim:

In the morning or after a few hours it take up to 20-30 seconds until the server sends the requested content, doesn't matter which space or page. After this first time access the content delivary is fast and really fine (below 1 second).

Found these unsolved thread on this, but unfortunately no answer to my question:

<https://community.atlassian.com/t5/Confluence-questions/Slow-quot-index-action-quot/qaq-p/776995#U1059301>

We use Confluence 6.10.1 on a virtualized Windows Server box here with a MS SQL Database (sorry, company policy). 4 Cores with 8 GB RAM and sufficient disk subsystem is in place - should be enough for approx. 50 users and only 5 editors.

Followed design guides / hardware requirements, checkt the caching statistics... no hints. BUT, currently i'm the unly user on the system!

It seems the system is sending some processes or services to sleep when it isn't used for a while. How to find them?

Thanks for any idea or hint!


Answers:
author: David Thielheim
body: Just for conclusion:

confluence seems to be having a problem with Microsoft Hyper-V dynamic disks which means that disks can automatically grow as more space is needed. Converting the disk to the type 'fixed', after idle time confluence responds three times faster than before.

Thanks...

David

comments: author: Julian Lam
body: Hi David,

3x faster meaning the first-load after idle takes 7 seconds instead of 20? In that case, that's what I'm seeing right now on my Linux box. Subsequent loads are speedy, but after some period of inactivity, it takes \~7 seconds of spinning before I get a response.

It's odd because this wasn't an issue with Confluence 5...


author: David Thielheim
body: Hi Julian,

yes, still have this issue. I think it got a little bit better, since switched off all the dynamic stuff (RAM, Harddisk) in Microsoft HyperV for my confluence box running on windows. But it still takes up to 10 Sec. showing me the accessed site.


author: Daniel Eads
body: Hey David,

Let's start digging in! You've provided a fair amount of detail, I have some ideas that hopefully we'll be able to track down with some additional info:

1. 8GB RAM is listed, what is allocated to Confluence's heap? We're looking for the xms/xmx values defined in setenv.bat or the Initial/Maximum values if you're running Confluence as a Service. Check out the [System Properties document](https://confluence.atlassian.com/doc/configuring-system-properties-168002854.html) if you need some guidance finding these.
2. What type of hypervisor are you using for the VM? In particular, VMware will try to recover idle memory, which could lead to the behavior you're seeing. There's a [lengthy document here](https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/perf-vsphere-memory_management.pdf) describing VMware's memory behavior.

As a band-aid to this behavior, you might be able to check the host every so often to keep it awake. If your server is exposed to the internet, you could try setting up a check with something like [UptimeRobot](https://uptimerobot.com/) every 5-10 minutes or so. Behind a firewall, you could use an internal tool like PRTG or Nagios to do a keyword-based uptime check.

Cheers,  
Daniel

comments: author: David Thielheim
body: Hi Daniel,

hopefully these are the two options we are looking for:

![Untitled.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/57300i54631510BF8DA50F/image-size/large?v=v2&px=999 "Untitled.jpg")

The confluence VM is running on a Microsoft Windows HyperV Host. I configured the VM not to use "dynamic RAM", it's permanently assigned. In the power options of the VM i already switched from "balanced" to "highest performance".

The VM itself is "awake" all the time and the service is allways available on the configured https port 443. I'm able to login via rdp or console without any delay. It's the service "Atlassian Confluence Confluence230718113355" that seems sending some subprocesses to sleep if not accessed for a while. Doing so it raises the CPU utilization for the amount of time (20-30 seconds) it takes to send the requested page and going down again after finish.


author: David Thielheim
body: Any ideas? Hint?

Cheers, David


author: Daniel Eads
body: Hey David,

Here's some thoughts:

1. You might want to consider increasing the highlighted values for Confluence's heap (from your screenshot). I haven't encountered a lot of instances lately that have run smoothly with the default 1GB and any amount of user-installed plugins. You mentioned that the VM has 8GB, so if Confluence is the only thing installed/running on this box, you hopefully have plenty of breathing room to allocate some more RAM. Depending on the amount of users you see concurrently, I might suggest increasing both values to 2048 (2GB) and going from there.
2. You can use [perfmon](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc749154(v=ws.11)) (Microsoft utility) for measuring system resource performance on both the guest and HyperV host. It's possible something isn't matching your expectations and viewing the live data would be a way to catch this. If you have other monitoring tools already in place, it would be good to keep an eye on those at the same time too.
3. The next time you expect the first load to be slow, can you try directly on the host instead of your local workstation? For this test, try using an account that's internal to Confluence's own user directory. We want to rule out any network congestion / LDAP directory warmups.


Tags: confluence-server

server