"MySQL Server has gone away" is a server issue. See this:
https://www.vbulletin.com/docs/html/...mysql_goneaway and this:
https://www.vbulletin.com/forum/show...265#post310265 You will need to talk to your host about this in order to get it resolved.
The wait_timeout is actually a MySQL variable. By default it is set to 28800, but most sites are fine with it set around 300.