We have a Cakephp 1.3 application that is connected with ORACLE 11g Database ,
First it was hosted on our in house server there was no problem , but as we moved to AWS , database is giving slow response some time , some time it is very fast .
Configuration is 32 GB RAM, Database and PHP Application is on same server , there can be any network issue for DB Connection .
What can be the Possible problems.
I have created test Page linked below , and code is :
<?php // Connects to the XE service (i.e. database) on the "localhost" machine
//echo "there"; die;
$conn = oci_connect('hrpay', 'hrpay', 'localhost/orcl');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);}
//die('here');
$stid = oci_parse($conn, 'SELECT * FROM makess.mst_company');
oci_execute($stid);
echo "<table border='1'>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
}
echo "</tr>\n";}
echo "</table>\n";?>
It is dynamically very slow .