you either have a huge DB which can sometimes create lag and eventually freeze

or one of your codes are bad so check any new codes you've added