'Symfony is slow on production server, not in local

I have a performance problem with my symfony stack.

Because an image is worth than a long text :

On production (AWS EC2 t2.medium) (2387ms, 84MiB)(ParamConverterListener take 2326ms and 84MiB..)

On local (51ms, 8MiB)(No ParamConverterlistener or under 1ms)

In local I used symfony server command to run my server, no extra configuration.

On server, I activate and configure Opcache, increase realpath size and ttl and use nginx sample configuration present in symfony documentation, APCu is activate too.

For database, I use AWS RDS, with default configuration.

My doctrine.yaml :

doctrine:
dbal:
    types:
        enumProjectStatus: App\Enum\EnumProjectStatus
        enumFeaturedPeriodArea: App\Enum\EnumFeaturedPeriodArea
    url: '%env(resolve:DATABASE_URL)%'
    options:
        1002: 'SET sql_mode=(SELECT REPLACE(@@sql_mode, "ONLY_FULL_GROUP_BY", ""))'
    mapping_types:
        enum: string
orm:
    auto_generate_proxy_classes: true
    naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
    auto_mapping: true
    mappings:
        App:
            is_bundle: false
            type: attribute
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App

If someone have any information about this ParamConverterListener (or BlameConverter when i'm login).

Thanks.

PS: I'm not an symfony and PHP expert. So if I missing something don't hesitate to tell me what.



Solution 1:[1]

problem is resolve when I set server_version in database connection configuration.

Thanks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Skalv