At my office, we have a php server and also a postgresql server. The php server querying local postgresql server is fast, but recently we are migrating the db to AWS RDS.
And now we run a simple query from the php server to AWS RDS can take like 30 seconds or more. But when using psql and connect to the RDS the query is fine.
I clone the php server and provision a EC2 on amazon then the PHP query RDS is fast. I was leaning toward a network bandwidth issue but when running psql the performance is fine. Then I thought it could be the code/illuminate/pdoconnector/php, but exact same code run fine on ec2.
anyone have any idea where I should investigate?