SQL connections close timeout, rework events module to reduce resources consumption