Slow response with symfony

Viewed 648

I have a symfony app (2.8.28) hosted in heroku and I can monitoring request with NewRelic and I realize that there some requests that are really slow and it is a really simple request which gets the API version and returned it in JSON format and sometimes it takes around 20 seconds ( sometimes), most of the times works really fast)

More in detail.

Controller

private $apiVersion;

public function __construct($apiVersion) {
    $this->apiVersion = $apiVersion;
}

/**
 * @Route("", name="api_version_index", defaults={"_format": "json"})
 */
public function indexAction() {
    return new JsonResponse(
        ['version' => $this->apiVersion]
    );
}

Controller.yml

services:
    controller.api.version:
        class: NewsBundle\Controller\Api\VersionController
        arguments:
            - %api_version%

parameters.yml

api_version: 2

And the captures from NewRelic which show the slow response:

Tracking slow response

Sometimes there are slow responses

0 Answers
Related