Move fridge out from wall..UNPLUG IT...check and clean any exposed coils and around compressor under bottom/back of fridge. Check compressor to see if mounting brackets/springs all firmly in place. Plug fridge back in and observe operation. If still knocking..likely that the compressor is going bad due to worn crank shaft/pistons. Likely time to replace.