HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Mysql : Aborted connection .../... (Got an error reading communication packets)

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
gotreadingerrorpacketscommunicationmysqlabortedconnection

Problem

This error message had submitted many times in this forum.

I have tried the following without success.

Context

This is a Symfony1/Doctrine1 web application.
The error appear on my computer and on a serveur (both on Ubuntu).
At the browser level (Chrome) I've got an error :

POST http://*****/administration_dev.php/utilisateur net::ERR_EMPTY_RESPONSE


Here's my computer details :

```
$ uname -a
Linux Bureau 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
$ dpkg -l |grep php
ii libapache2-mod-php 1:7.0+35ubuntu6 all server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii libapache2-mod-php7.0 7.0.4-7ubuntu2.1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php 1:7.0+35ubuntu6 all server-side, HTML-embedded scripting language (default)
.../...
$ dpkg -l |grep mysql-
ii mysql-client-5.7 5.7.13-0ubuntu0.16.04.2 amd64 MySQL database client binaries
ii mysql-client-core-5.7 5.7.13-0ubuntu0.16.04.2 amd64 MySQL database core client binaries
ii mysql-common 5.7.13-0ubuntu0.16.04.2 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server 5.7.13-0ubuntu0.16.04.2 all MySQL database server (metapackage depending on the latest version)
ii mysql-server-5.7 5.7.13-0ubuntu0.16.04.2

Solution

You are running MySQL 5.7 with PHP on the one server. This shows me that your server is not dedicated to MySQL. PHP and MySQL are evidently competing for RAM.

I also do not see any attempt to set the InnoDB buffer pool size. The default value for innodb_buffer_pool_size is 128M (134217728).

Please keep in mind something about max_allowed_packet. As the variable name suggests, it is the maximum size allowed for a MySQL Packet. According the MySQL Documentation, the MySQL Packet does not start out as 1G. Its initial size is based on the value of net_buffer_length. The MySQL Packet will then dynamically expand to max_allowed_packet as needed.

Your attempts to tune around the MySQL Packet will be nullified by a lack of RAM.
SUGGESTION #1

  • Install PHP on another server that can be a dedicated web server.



  • Increase the amount of RAM on the DB Server



SUGGESTION #2

If you cannot afford another server, then just increase RAM and the Buffer Pool size.
SUGGESTION #3 (OPTIONAL)

Since you are using MySQL 5.7, you can expand the Buffer Pool dynamically.

Do the following to set it to 2GB:

mysql> SET GLOBAL innodb_buffer_pool_size = 1024 * 1024 * 1024 * 2;

Code Snippets

mysql> SET GLOBAL innodb_buffer_pool_size = 1024 * 1024 * 1024 * 2;

Context

StackExchange Database Administrators Q#144773, answer score: 2

Revisions (0)

No revisions yet.