Answer the question
In order to leave comments, you need to log in
Symfony 2.8 firewall is very slow. Why?
Good afternoon.
There is a project on symfony 2.8 standard edition that does not use a database ( without doctrine and swiftmailer). Accordingly, there are no extra settings in the config (parameters for connecting to the database, and so on).
All data is obtained from the api of a third-party service (don’t ask why then you don’t like it on the symphony, and not the js-framework, but the customer wanted it that way)
In the prod environment on the server (php 7) , the firewall works for a very long time . It also happens in dev on local, but the difference is 10 times in time.
app/config/security.yml file code
security:
providers:
in_memory:
memory: ~
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
pattern: ^/.*
form_login:
always_use_default_target_path: false
default_target_path: /
target_path_parameter: _target_path
use_referer: true
login_path: user_registration_page
access_control:
- { path: ^/login_check, roles: IS_AUTHENTICATED_ANONYMOUSLY }
# и так далее
Answer the question
In order to leave comments, you need to log in
Found out what the problem was. Installed the BlackFire.io profiler (by SensioLabs). About 99% of the time the curl_exec() function was executing. It was useful to deal with it, it turned out that requests to api via curl (I use the guzzle client) sometimes took a very long time. I set the chaser ipv4 execution flag and everything quickly worked.
Bottom line - the problem is not in the firewall (although symfony web-profiler pointed to it), but in the conversion of the domain to ip.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question