I have a server which relies heavily on a MYSQL database. Recently, there have been load issues and max mysql connection issues.
My idea is to have a primary server with the php code and files and a database, and a secondary server with only the database duplicated (so that both databases are the same). The user will access the primary server, and within the PHP code, half the connections will be made to the database on the primary server, and half to the database on the secondary server.
My question is is this the best way to reduce the server load? Or should the files be duplicated as well so that the server side processing of the php code is also split between both servers.