Thanks for your reply, I've already checked these links. I am almost sure it has something to do with the Perl code, since it only affects the main process and not its childs.
If I take a look at the MySQL connections, the connection of the main process never changes, although the connection is lost quite often.