add the server loop as a service and add a new parameter keepalive

Currently when the MySQL server isn't contacted within a certain amount of time the connection will be dropped and not picked up again, added a keepalive with configuration to make sure the connection stays open