# Undo size increasing Percona MySql 5.6

**URL:** <https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397>\
**Category:** Percona Server for MySQL 5.6\
**Tags:** mysql\
**Created:** [May 9, 2021, 8:41am UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397 "2021-05-09T08:41:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daljit1](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Daljit1](https://forums.percona.com/u/Daljit1)\
**Post date:** [May 9, 2021, 8:41am UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/1 "2021-05-09T08:41:05Z")

</div>

Hi Guys,

Please suggest me how i can truncate or drop undo tablespace because its size increasing and below are the parameter setting.

innodb\_version | 5.6.34-79.1

(root@)\>show variables like ‘innodb\_undo%’;  
±------------------------±------+  
| Variable\_name | Value |  
±------------------------±------+  
| innodb\_undo\_directory | . |  
| innodb\_undo\_logs | 128 |  
| innodb\_undo\_tablespaces | 12 |  
±------------------------±------+

-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo004  
-rw-rw---- 1 mysql mysql 35G May 9 09:36 undo012  
-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo002  
-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo003  
-rw-rw---- 1 mysql mysql 35G May 9 09:36 undo009  
-rw-rw---- 1 mysql mysql 35G May 9 09:36 undo011  
-rw-rw---- 1 mysql mysql 35G May 9 09:36 undo010  
-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo006  
-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo005  
-rw-rw---- 1 mysql mysql 35G May 9 09:36 undo008  
-rw-rw---- 1 mysql mysql 38G May 9 09:36 undo007  
-rw-rw---- 1 mysql mysql 42G May 9 09:36 undo001

Thanks

---

<div class="post-metadata">

**Author:** ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)\
**Post date:** [May 10, 2021, 12:59pm UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/2 "2021-05-10T12:59:46Z")

</div>

Hi Daljit1,

Sadly, on 5.6 it’s not possible to truncate the undo tablespaces [MySQL :: MySQL 5.6 Reference Manual :: 14.6.3.3 Undo Tablespaces](https://dev.mysql.com/doc/refman/5.6/en/innodb-undo-tablespaces.html) , but it’s possible on 5.7: [MySQL :: MySQL 5.7 Reference Manual :: 14.6.3.4 Undo Tablespaces](https://dev.mysql.com/doc/refman/5.7/en/innodb-undo-tablespaces.html)

Do note that MYSQL 5.6 already reached EOL and is strongly suggested to upgrade to 5.7

I see that all the undo tablespaces were updated “around the same time”. Chances are there was a very large transaction ongoing, and the inability of MySQL purge threads to remove undo entries until the transaction finished, made the files grew so much.

Next time undo logs are needed, the existing files unused internal space will be used instead of growing the files again (unless you do a larger transacion that requires even more undo log entries).

It’s suggested that for large transactions, you split them un chunks, and also execute them during off peak hours because of MVCC [MySQL :: MySQL 5.6 Reference Manual :: 14.3 InnoDB Multi-Versioning](https://dev.mysql.com/doc/refman/5.6/en/innodb-multi-versioning.html)

Regards

---

<div class="post-metadata">

**Author:** ![Daljit1](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Daljit1](https://forums.percona.com/u/Daljit1)\
**Post date:** [May 10, 2021, 2:26pm UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/3 "2021-05-10T14:26:42Z")

</div>

Hi C Tutte,

Thanks a lots for described in details and quick response.

I will upgrade with 5.7 version soon and please send me document upgradation from 5.6 to 5.7 step by step.

I really like the Percona community.

regards,  
Daljit Singh

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [May 10, 2021, 4:26pm UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/4 "2021-05-10T16:26:49Z")

</div>

Hello @Daljit1,  
Upgrading to 5.7 from 5.6 is very simple. Stop 5.6. Install 5.7 packages (replace 5.6). Start 5.7. Very simple. Be sure to take a complete backup of the 5.6 data directory after you stop mysql. Just copy the directory somewhere safe.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 25, 2021, 3:06pm UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/7 "2021-08-25T15:06:28Z")

</div>

@alexsunny123 You might want to check your computer for spyware. Your last post included some injected URLs

---

<div class="post-metadata">

**Author:** ![Daljit1](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Daljit1](https://forums.percona.com/u/Daljit1)\
**Post date:** [September 14, 2021, 2:23pm UTC](https://forums.percona.com/t/undo-size-increasing-percona-mysql-5-6/10397/8 "2021-09-14T14:23:36Z")

</div>

Hi Team,

Greeting!

Any reason behind that the undo size getting increasing.(mysql 5.6)

-rw-rw---- 1 mysql mysql 77G Sep 14 14:31 undo011  
-rw-rw---- 1 mysql mysql 85G Sep 14 14:40 undo007  
-rw-rw---- 1 mysql mysql 85G Sep 14 14:47 undo006  
-rw-rw---- 1 mysql mysql 85G Sep 14 15:00 undo002  
-rw-rw---- 1 mysql mysql 85G Sep 14 15:03 undo003  
-rw-rw---- 1 mysql mysql 92G Sep 14 15:07 undo001  
-rw-rw---- 1 mysql mysql 85G Sep 14 15:07 undo004  
-rw-rw---- 1 mysql mysql 77G Sep 14 15:07 undo009  
-rw-rw---- 1 mysql mysql 77G Sep 14 15:13 undo012  
-rw-rw---- 1 mysql mysql 77G Sep 14 15:15 undo008  
-rw-rw---- 1 mysql mysql 85G Sep 14 15:16 undo005  
-rw-rw---- 1 mysql mysql 77G Sep 14 15:17 undo010

regards,  
Daljit Singh
