Finally managed to get some clue here. I had performance issues occasionally where the site doesnt respond for long periods. Tried setting execution timeout in php to 1 second.
This helped me to break the code execution and display me the part of the code that takes long time.
Looks like its the session_start() function call thats taking long time to execute (happens rarely) on qa-include\app\users.php. line 146.
I managed to create a seperate session path for files to store. This has helped me improve some performance but still the issue exists.
I can see a few solutions like
1>closing write access into the session. This will prevent the issue from occuring further.
2>using database or memcached session handler instead of files.
Anything we can do to solve this issue ?