/etc/my.cnf
max_allowed_packet=XXXXM
max_allowed_packet=128M
[mysqld]
# this happens when max_allowed_packet=1M but not when max_allowed_packet=2M,
# actually 1638400 is already fine
set-variable = max_allowed_packet=1024000
set-variable = key_buffer=128M
set-variable = max_user_connections=50
set-variable = tmp_table_size=128M
set-variable = table_cache=480M
set-variable = query_cache_size=32M
set-variable = sort_buffer=2M
set-variable = record_buffer=1M
set-variable = myisam_sort_buffer_size=64M
set-variable = myisam_max_sort_file_size=96M
set-variable = back_log=100
set-variable = interactive_timeout=60000
set-variable = wait_timeout=60000
set-variable = connect_timeout=60000
set-variable = net_read_timeout=60000
set-variable = open_files_limit=30000
set-variable = thread_concurrency=2
set-variable = thread_cache_size=64