0

As per new relic data NativeSession::startSession taking almost 80% of time ( 6sec) in Laravel some times

/**
 * Starts the session if it does not exist.
 *
 * @return void
 */
protected function startSession()
{
    // Check that the session hasn't already been started
    if (session_status() != PHP_SESSION_ACTIVE && ! headers_sent()) {
        session_start();
    }
}

My controller logic takes less than <800ms but entire request and response takes ~7 sec. Sometimes it will be faster (<1 sec).

For sessions I'm using Redis and I belive there is no session lock in Redis. So if muliple request comes from same user for same session it should not block as per theory.

Screenshot of new-relic data

It might be similar to session_start seems to be very slow (but only sometimes) where session start creating issue

I want some of the request doesn't wait for session as it is read only and won't corrupt the session value

Any solution to fix this or unblock requests?

SteDS
  • 1
  • 2
  • What's Catalust Sentinel Native Session? To make sure you are looking for the problem in the correct location try switching to the built-in Laravel session to see if the issue persists. Also try switching to a file driver to see if that helps. – apokryfos Aug 03 '23 at 13:13
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 03 '23 at 16:22
  • @apokryfos It is authentication & authorization framework. https://github.com/cartalyst/sentinel. I'm not sure if I can change only session to default laravel. I need to check – SteDS Aug 04 '23 at 04:38

0 Answers0