I have a Ubuntu server that runs a daemon snmptrapd to handle incoming SNMP traps. This loads a php script for each trap, there are thousands of devices that we manage so there are always lots of traps coming in, and this is taking a lot of resource to handle. Because this script has many queries and every time it needs to create a DB connection. So I need to optimize this script.
Is it possible to have some sort of daemon with persistent database connections to PSQL? So my script can use that connection each time when it runs.
I'm new to this subject and please go easy on me. Any help will be much appreciated. :)