I have a python script that is currently connecting to my mysql database every 60 seconds, checking something, then closing the connection, so every minute I am doing this open/close of the connection. Is it more expensive for me to do this, or to just leave the connection open since I'm executing my code so frequently?
What are the upsides and downsides of keeping the connection open for maybe 8 hours at a time, or opening and closing it 480 times over the course of those eight hours?