V
V
Vyacheslav Grachunov2020-01-11 21:58:26
MySQL
Vyacheslav Grachunov, 2020-01-11 21:58:26

MySQL connection error. How to fix?

When scripts that intensively pull the database are running, the Django 2.2 admin panel starts periodically giving such an error, while the scripts themselves work fine and do not fall.

Lost connection to MySQL server at 'reading initial communication packet', system error: 95

What can be wrong? In Django or in the database or what else? How to fix?
OS: Ubuntu 18.04
Base: MariaDB 10.4.7
Python 3.6.8
Django 2.2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-01-11
@Qwentor

You create a new connection for every request. Under load, your DBMS will spend more time establishing and breaking connections than executing queries. Well, it looks like your project is exceeding the number of connections allowed by the DBMS configuration. Try using persistent connections .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question