Confluence crash when copying pages
Asked by Zachary Miller:

In our confluence instance we encounter a crash that occurs whenever a user attempts to copy a page with many attachments (30+), our instances crashes. While I understand it is a bad practice to be bulk copying attachments, and we have worked with our user base on this process, we would still like confluence to be able to handle this action.

Atlassian originally recommended the solution states here <https://confluence.atlassian.com/confkb/confluence-slows-and-times-out-during-periods-of-high-load-due-to-database-connection-pool-146407630.html>

This however has not seemed to resolve the issue

Reading through our logs it looks like Confluence sees the thread get stuck and is then unable to handle the exceptions and crashes.


Answers:
author: Diego
body: Hello there!

Zachary, as I understand the page copy procedure fails when you try to execute it with pages that contain a considerable amount of data. Is that correct?

It is true that you might need to increase the **connection** **pool**for your instance. However, we still need to know if this pool is supported by your database.

If you increase the connection pool for Connie but your database is not capable of handling it, this will act as if nothing has changed. The article you linked is quite relevant when dealing with this type of issue:

**[Confluence slows and times out during periods of high load due to database connection pool](https://confluence.atlassian.com/confkb/confluence-slows-and-times-out-during-periods-of-high-load-due-to-database-connection-pool-146407630.html?_ga=2.250536591.848838361.1556543639-79410561.1553795485)**

According to your description this steers towards a performance tuning issue. This being true, we would have many other variables at hand:
> 1. Allocated memory
> 2. Resources available for Connie
> 3. Third-party apps

Usually, we tend to look into **memory usage and allocation** right at the start when dealing with performance issues. You may also need more memory allocated for your instance so it can perform the requested operations. Here is a quick guide on how to increase the 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)**

Another detail we can dig into is the **CPU usage** during the page copy operation. If this reaches 100% and CPU is at maximum usage, we might need to resize the resources offered to Confluence.

One thing we could try to rule out is if this is related to the **number of attachments only** or with the final size of data being copied by Confluence. To try this, we can try the following:
> 1. Create a **new page**
> 2. Attach **thirty or more (30+)** attachments to it
>    1. each attachments should not exceed a few KBs in size, text files if you will
> 3. Publish the page
> 4. Try copying it

As a temporary workaround, we could do this to copy page content to somewhere else:
> 1. Access the desired page
> 2. Enter edit mode
> 3. Select all page content
> 4. Copy it
> 5. Go to the other desired page
> 6. Enter edit mode
> 7. Paste the copied content

Performance issues are on their own league when troubleshooting them, so this might take longer than expected to fine tune your instance to the necessities presented by your user base. While you are correct that this is not an ideal situation, there are many processes involved in the copy process.

There are some performance issues in older versions while trying to copy pages with many child pages. You can take a look here:

**[CONFSERVER-44950 \| Large page tree move fails after 3 minutes](https://jira.atlassian.com/browse/CONFSERVER-44950)**

So, here are some other points for us to look into:
> 1. Are there many child pages under this page?
> 2. Does this happen with any page that has 30+ attachments?
> 3. Has this worked at some point in the past?
> 4. Are there enough resources for Confluence?

Looking forward to your reply Zachary!

comments: author: Zachary Miller
body: [@Diego](/t5/user/viewprofilepage/user-id/1188952)

Thank you for the thorough reply. I believe that you have answered my question.


author: Diego
body: Great to know that I was able to help you out Zachary!