java cpu performance extremely high
Asked by javier:

Hi support, we have a confluence server instance working in a linux VM machine:

VM Ware settings:

\* 1 CORE (8 proccessors). Intel Xeon E5506 @ 2.13 GHz

\* 5 GB Memory

\* 40 GB Hard disk

Virtual Server:

\* DISTRIB_ID=Ubuntu  
\* DISTRIB_RELEASE=16.04  
\* DISTRIB_CODENAME=xenial  
\* DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

\* Confluence server=6.7.1 7601

\* PostgreSQL=9.6.7

\* Java=1.8.0_162

\* Apache Tomcat=8.0.48

....

We have only 10 users and just some hundreds of pages. We are experiencing some web pages problems and java high CPU usage (maybe they are not related).

Regards

Javier

![00-java_web.jpg](/t5/image/serverpage/image-id/40562iB31D2DFC9A2BF328/image-size/large?v=v2&px=999 "00-java_web.jpg")![01-java_web.jpg](/t5/image/serverpage/image-id/40564i7F07E74042A4DE4F/image-size/large?v=v2&px=999 "01-java_web.jpg")![java_ps.jpg](/t5/image/serverpage/image-id/40563i34043A2DDAB43641/image-size/large?v=v2&px=999 "java_ps.jpg")


Answers:
author: Diego
body: Hello there Javier!  
We can start by checking the memory that Confluence is using by going here:
> 1- Click the **cog icon at the top right corner**   
> 2- Select **General Configuration**   
> 3- Search for **System Information** in the left side panel  
> 4- Once you are there, scroll down until you find **Java VM Memory Statistics** section  
> 5- If possible, take a screenshot of **only the memory usage** and share it here with us

Further, could you share with us some information on the **XMS and XMX values** that are set for your Confluence instance?  
You can find these values under:
> - \<cofluence-install\>/bin/setenv.sh file

Could you clarify if your instance is running on a **VM with only one processor core** assigned to it? If this is the case, you can try to increase it **two processor cores** .  
Having only one core in your VM could be the reason **CPU usage is high even** during low load in Confluence.

The minimum hardware requirement for Confluence is a Core 2 (dual core) and 2GB of RAM for 5 concurrent users:

**[Server Hardware Requirements](https://confluence.atlassian.com/conf59/server-hardware-requirements-guide-792499823.html)**

Let us know about your findings!


author: javier
body: Hi Diego, thanks for your quick answer.

I've just changed CPU configuration from 1 core (8 proccessors) to 2 cores (4 proccessor each) althought obviously results are similar. As far as we don?t have more physical resources, we are going to plan for next year a fresh installation directly over hardware.

Meantime, I send you a couple of screenshots with setenv.sh and java memory usage just in case you could see something wrong.

Regards

Javier![Java_Memory.png](https://community.atlassian.com/t5/image/serverpage/image-id/40837i05B0AC3F62D58EE6/image-size/large?v=v2&px=999 "Java_Memory.png")![setenv.sh.png](https://community.atlassian.com/t5/image/serverpage/image-id/40838i3CF8C01407C8DD4B/image-size/large?v=v2&px=999 "setenv.sh.png")

comments: author: Diego
body: Hello there Javier!  
One thing we could improve is the allocated memory set for Confluence. It is a good idea to have **at least 2GB of heap** set for Confluence 6.x to run with. You can check this article on how to increase memory:

**[How to fix out of memory errors by increasing available memory](https://confluence.atlassian.com/confkb/how-to-fix-out-of-memory-errors-by-increasing-available-memory-154071.html)**

Currently, your **memory usage is low** (less than half of your 1GB). However plugins, user macros and the like can **increase this usage considerably** without increasing the number of users currently working. So it is a good idea to have this in mind when provisioning resources for the application to run with.

Further, the memory usage we have displayed with the top command may be related to **Linux memory caching** . There is a funny website that does explain this, it is called **Help! Linux ate my RAM!**:

**[Linux Ate My RAM](https://www.linuxatemyram.com/)**

There you will find a quick explanation of how this works and what a healthy Linux looks like and when you should be worried.

Also, how is the **CPU usage now** , after the **new settings** have been applied?  

Except for the CPU usage (which I believe should be better after the new settings), your instance looks healthy!


author: javier
body: Hi Diego, taking into account next holidays period, you can put the ticket as resolved. We will contact you again in case we need further support.


author: Diego
body: Thanks for updating us Javier.

Have a great holiday season!


Tags: confluence-server

server