# Slow to create new mysql sessions

**URL:** <https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336>\
**Category:** Percona Distribution for MySQL\
**Created:** [April 11, 2023, 12:33pm UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336 "2023-04-11T12:33:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamie\_Downs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jamie_downs/32/5836_2.png) [@Jamie\_Downs](https://forums.percona.com/u/Jamie_Downs)\
**Post date:** [April 11, 2023, 12:33pm UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336/1 "2023-04-11T12:33:06Z")

</div>

Hello,  
When we have a high session count we experience slowness to create new sessions. We are not 100% sure it is on the MySQL end. Is there way to profile connection times to MySQL?  
max\_connections = 2048  
slow\_launch\_time = 2  
Slow\_launch\_threads = 1.  
Once the sessions get above 500 performance degrades. There are no long running queries or excessive cpu, IO or network bandwidth issues.  
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:** [April 11, 2023, 3:03pm UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336/2 "2023-04-11T15:03:36Z")

</div>

Hi Jamie\_Downs,

What version are you in ?  
What is the current value of “back\_log”? [https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html)  
What is the current value of show global status like ‘%conn%’; ?  
Do you see any errors on the error.log?

Last, do you have PMM installed? [Installing Percona Monitoring and Management (PMM) Software - Percona](https://www.percona.com/software/pmm/quickstart)  
PMM will allow you to monitor all mysql status counters and maybe there is some other underlying issue that you are not getting.

Regards

---

<div class="post-metadata">

**Author:** ![Jamie\_Downs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jamie_downs/32/5836_2.png) [@Jamie\_Downs](https://forums.percona.com/u/Jamie_Downs)\
**Post date:** [April 11, 2023, 6:18pm UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336/3 "2023-04-11T18:18:54Z")

</div>

Hello Carlos,  
Many thanks for responding.  
We are currently using 5.7. Looking to upgrade to 8.0 later in the year.  
back\_log = 459.

```auto
show global status like '%conn%';
+-----------------------------------------------+---------------------+
| Variable_name | Value |
+-----------------------------------------------+---------------------+
| Aborted_connects | 26890 |
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 3555307 |
| Locked_connects | 0 |
| Max_used_connections | 1341 |
| Max_used_connections_time | 2023-03-25 04:06:51 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 115 |
+-----------------------------------------------+---------------------+

```

There are no errors in the log.  
Do you know if there a way to profile connections?

---

<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:** [April 11, 2023, 7:32pm UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336/4 "2023-04-11T19:32:31Z")

</div>

Hi again Jamie\_Downs,

There is no easy way to profile connections on the MySQL server. Likely you will need to do some tests on the OS to discard MySQL, or check what other counters do spike when you experience slowness. For the latter I would suggest you use PMM.

Also make sure that you are up to date with MySQL/Percona Server binaries and the OS version to discard any existing regression or bug.

Regards

---

<div class="post-metadata">

**Author:** ![Jamie\_Downs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jamie_downs/32/5836_2.png) [@Jamie\_Downs](https://forums.percona.com/u/Jamie_Downs)\
**Post date:** [April 14, 2023, 9:21am UTC](https://forums.percona.com/t/slow-to-create-new-mysql-sessions/21336/5 "2023-04-14T09:21:03Z")

</div>

Thanks Carlos. We will keep digging.
