Asterisk mysql connect

Hi,
i have a production server having asterisk[Running asterisk 1.4 version] and one more server which is acting as a db server.
Ping statistics between my production server and db server[Running mysql 5.1] will be around 0.2 msec on average.
i am using MYSQL connect function in my dialplan for our database operations.

Asterisk seems to look good as long as ping response is 0.2 msec.
Some times ping response will go beyond 1msec or 2msec and at that point time asterisk MYSQL connect function seems to be having some problem and it is sometimes killing the asterisk also.
i moved the db in to the same server instead of remote server and tested and is fine.
Whenever there is a ping delay for the remote mysql server it is giving the issues.
Please help.