What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Can anyone tell me, where to find the xdebug profiler output? In xdebug.ini, profiler is permanently

UU07J5ZGC
UU07J5ZGC Posts: 11 πŸ§‘πŸ»β€πŸš€ - Cadet

Can anyone tell me, where to find the xdebug profiler output? In xdebug.ini, profiler is permanently activated (to eliminate issues with remote enabling) and the output path ist specified:

zend_extension=xdebug.so
xdebug.profiler_enable=1
xdebug.trace_enable_trigger=1
xdebug.profiler_enable_trigger=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_host=${SPRYKER_XDEBUG_HOST_IP}
xdebug.remote_port=9000
xdebug.profiler_output_dir=/tmp/xdebug/profiler
xdebug.trace_output_dir=/tmp/xdebug/trace
# This is needed to prevent max recursion exception when Twig templates are very complicated
xdebug.max_nesting_level=1000

I'm using Docker environment. The containers are started with -x, but in CLI container, /tmp directory stays empty. Any ideas?

Comments

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    are you sure that profiler is active? it would significantly slow down the system

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    it definitely should use provided output dir

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited April 2020

    Just an idea:
    Try to set xdebug.profiler_enable_trigger=0
    To be sure it is always activated by xdebug.profiler_enable=1

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    In order to prevent the profiler to generate profile files for each request, you need to setΒ *xdebug.profiler_enable*Β to 0 so this should not prevent profiling of each request

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe directory does not exist and user have no rights to create it

  • UU07J5ZGC
    UU07J5ZGC Posts: 11 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks for your ideas. Just to be sure, I've set the xdebug.*_enable_trigger settings to 0:

  • UU07J5ZGC
    UU07J5ZGC Posts: 11 πŸ§‘πŸ»β€πŸš€ - Cadet

    But I can still see no profiler output in /tmp/ inside the CLI container. I also can't see any real performance impact when browsing through ZED πŸ€” (but phpinfo states the profiler to be enabled)

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    Just to clarify…

    If you run docker/sdk cli -x it is only means that console commands run there are profiled.

    If you need to profile Zed Backoffic -
    docker/sdk run -x
    And then look into

    docker exec -it spryker_zed_eu_1 bash
    

    (container name can vary depends on deploy yml)

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited April 2020

    But I would suggest Blackfire instead. You can find unfinished PR at https://github.com/spryker/docker-sdk/pull/87

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet
  • UU07J5ZGC
    UU07J5ZGC Posts: 11 πŸ§‘πŸ»β€πŸš€ - Cadet

    I'm starting my containers with docker/sdk up -x. The CLI container is only used for checking the output dir (which stays empty after browsing ZED). Even if I connect to the zed container directly, /tmp/ stays empty

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited April 2020

    No sense to run cli to check output dir, as /tmp folder is not shared between containers.

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    What if if you run console command in cli -x ? Still empty?

  • U01DHAW94DQ
    U01DHAW94DQ Posts: 12 πŸ§‘πŸ»β€πŸš€ - Cadet

    I've solved a similar problem, by mkdir -p /tmp/xdebug/profiler && chmod a+w /tmp/xdebug/profiler

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    It seems we need to initialize it in Dockerfile. Thanks for the catch.