mysql server has gone away error on small load in server


I experienced strange problems nowadays.

sometimes, it takes too long time to open all the pages of our site incuding db connection and query.

static pages is opened so quickly.

But this time load of db server is so low (0.03 or so).

When I see show processlist, there are almost 50~70 connected threads( only 2 or 3 running threads).

Our max connection is 300 and memory is more than 8 giga.

wait_timeout is set to 120 seconds and connect_timeout is set to 20 seconds.

of course, slow queries above 1 seconds almost does not exist.

When our site goes slow, all the pages including db connection is slow. all db related reions in a page cannot be displayed.

Finally, some pages display MySQL server has gone away error with related query.

moreover thare are many warnings in mysql error log aborted connections due to timeout. Normal situation when site is so fast, there are small aborted connections in error log file.

I think our problems are not related to the busy connections to db server.

I tried to find answers or solutions for this problem in google, however, I cannot find relevant solutions on this problem.

we backup binary log using rsync periodically (once per 30 minutes).

But the rsync backup of binary log files are so fast.

If file lock on binary log makes slow down updates, only related some pages on file lock conflict may lost existing connection due to wait_timeout.

But almost every page go slow down.

In the connection error page of mysql manual, manual said that increasing connect_timeout can be helpful.

In our situation, db server has small work loads and web server has also small work loads and almost every page including db connection cannot be opened. So I guest the problems may be due to the network problem between db server and web server.

The db server and web server lies in same network and use internal ip. So in normal situation, the connection request from web server will be really quickly handled by db server.

Mysql Manual also tells that network card duplex mode may be one of reasons for server has gone away problem.

Netork cable or hubs or switches may be one of reasons.

Are there another reasons which can cause the connection error problems like us except for network related hadware probems?

If anyone knows this problem, please let me explain some guides on this problem.

Thanks in advance.