0

I have 2 servers (both running Ubuntu 12.04)

APP server

  • running apache2, PHP7.2 and a CakePHP 2.0 APP

DATABASE server

  • running mysql 5.7

When I'am trying to insert into the database a big blob (starting > 40MB) the mysql server returns the following errors to the APP:

Error while sending QUERY packet

General error: 2006 MySQL server has gone away

Also in /var/log/mysql/error.log - i found the following error:

[Note] Aborted connection 123456 to db: 'database_name' user: 'database_username' host: 'remote_ip_address' (Got an error reading communication packets)


in PHP.ini, i've maxed: max_execution_time, memory_limit in MySQL configs, i've maxed wait_timeout, net_read_timeout, net_write_timeout, max_allowed_packet

I've checked free -m there is enough ram. i am not using persistent connection, i've tested multiple times and its look like failing between 19-22 seconds everytime. i don't have other idle mysql procceses.

Can you guys suggest how i can debug this futher? I have no ideas left. Maybe a firewall issue? But how i can debug that. Thanks!

2
  • What query were you running? How long did it run before timing out? SHOW VARIABLES LIKE '%timeout%';
    – Rick James
    Jul 4 at 22:50
  • I've write it up. after 19-22 seconds. its an INSERT query of a BLOB (55MB file). all variables from '%timeout%' are increased to their max.
    – updevs
    Jul 5 at 7:23

1 Answer 1

0

Not even LONGBLOB can handle more than 4GB; certainly not 55GB. Do not plan on putting that big a cell into a MySQL table.

You could break it into chunks, but that is a pain.

Instead, make a file, then have the URL provide a way to get to the file -- just a JPGs are handled on web pages.

1
  • I don't know where i write 55GB. Its happening starting with 55MB (wich is low and not a big problem to store). I cannot change the whole APP back to local storage. i need a fix for this problem. (its already in production like this for years)
    – updevs
    Jul 5 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .