NativeSession::startSession 在 Laravel 中花费更多时间 - Sentinel

问题描述 投票:0回答:0

根据新的遗迹数据 NativeSession::startSession 在 Laravel 中有时占用了近 80% 的时间(6 秒)

/**
 * 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();
    }
}

我的控制器逻辑需要少于 <800ms but entire request and response takes ~7 sec. Sometimes it will be faster (<1 sec).

对于会话,我使用 Redis,并且我相信 Redis 中没有会话锁。因此,如果多个请求来自同一会话的同一用户,那么根据理论,它不应该被阻止。

Screenshot of new-relic data

它可能类似于session_start似乎非常慢(但只是有时)会话开始创建问题

我希望某些请求不等待会话,因为它是只读的并且不会损坏会话值

有任何解决方案可以解决此问题或取消阻止请求吗?

laravel sentinel cartalyst-sentinel
© www.soinside.com 2019 - 2024. All rights reserved.