PHP Session Causing Page To Not Load

This is a bug seen on the production server. On dev instance the code seems to be working just fine. Infact, in multiple different AWS instances the code is running just fine.

The Bug:
On loading a specific page that’s pageA.php, the session is getting problematic. Before trying to load pageA.php all other pages are loading perfectly fine. But as soon as I load the page pageA.php, all other PHP pages stop loading. ( keeping loading for 5 min+ ) & at show HTTP 503 error.

currently pageA.php is loading a lot of values into session for quick referencing data. & is infact working just find on all other AWS instances.

I’ve tried restarting the IIS server. Again same story, all pages load fine, until I load pageA.php. Then everything stops loading with the 503 error.

Checked server machine for load, CPU at 2-5% & Memory at 10% utilization. So doesn’t seem to be any kind of heavy load on the system either.

Tried destroying & recreating session in another PHPfile.

<?php

session_start();
session_destroy();
session_start();

// Check if there are any session variables set
if (!empty($_SESSION)) {
    echo '<table border="1" cellspacing="0" cellpadding="10">';
    echo '<tr><th>Session Index</th><th>Value</th></tr>';
    
    // Loop through each session variable and print its index and value
    foreach ($_SESSION as $index => $value) {
        echo '<tr>';
        echo '<td>' . htmlspecialchars($index) . '</td>';
        echo '<td>' . htmlspecialchars(print_r($value, true)) . '</td>';
        echo '</tr>';
    }

    echo '</table>';
} else {
    echo 'No session variables are set.';
}

?>

But even this file refused to load & goes to HTTP 503.

I’ve removed the session_start() & all other related code, just tried

echo " Hello ";

Works just fine. So my diagnosis is something is wrong with session, but can’t figure out how to debug it or what the issues exactly is. Can’t share code due to confidentiality. Any help in debugging is appreciated.