# back_log

> Depth of the listen queue for incoming TCP connections.

Source: https://sqlly.app/sql-configuration/mysql/back-log
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).

**Default**

`-1 (autosized)`

**Range**

1 to 65535

**Restart needed**

Yes

**Default checked on**

MySQL 8.4 LTS

## What it does

When many connection requests arrive within a very short time, faster than the main thread can check each one and start a thread for it, the extras queue up to this depth. Beyond the depth the OS refuses new connections, which clients see as failed or timed-out connects. It autosizes to max_connections so the queue can absorb a full connection burst.

## Default value

`-1 (autosized)`. Autosized to max_connections, 151 with defaults (MySQL 8.4); do not assign -1 yourself.

## Check the current value

```
SHOW GLOBAL VARIABLES LIKE 'back_log';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'back_log';
```

## Change it

```
SET PERSIST_ONLY back_log = 2048;
-- then restart mysqld (or set it under [mysqld] in my.cnf)
```

Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.

## When to change it

When clients fail to connect during a reconnect burst, such as after a failover or an application restart, while Threads_connected stays below max_connections.

## What can go wrong

The OS caps the queue on its own: on Linux the effective value is the smaller of this and net.core.somaxconn, so a large setting can sit silently capped. Requests that do not fit the queue are refused, not delayed.

## Questions about back_log

### What is the default value of back_log in MySQL?

-1 (autosized). Autosized to max_connections, 151 with defaults (MySQL 8.4); do not assign -1 yourself.

### Does changing back_log require a restart?

Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.

### When should I change back_log?

When clients fail to connect during a reconnect burst, such as after a failover or an application restart, while Threads_connected stays below max_connections.

Back to all [MySQL settings](https://sqlly.app/sql-configuration/mysql), or check the [MySQL manual](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html) for every option.

## Related MySQL settings

- [`max_connections` Maximum simultaneous client connections.](https://sqlly.app/sql-configuration/mysql/max-connections)
- [`thread_cache_size` Threads kept for reuse after a client disconnects.](https://sqlly.app/sql-configuration/mysql/thread-cache-size)
- [`connect_timeout` Seconds the server waits for a client to answer the handshake.](https://sqlly.app/sql-configuration/mysql/connect-timeout)
