Skip to content

feat(profiling) add phases of inactivity to timeline#2315

Closed
realFlowControl wants to merge 12 commits into
masterfrom
florian/add-idle-phase-to-timeline
Closed

feat(profiling) add phases of inactivity to timeline#2315
realFlowControl wants to merge 12 commits into
masterfrom
florian/add-idle-phase-to-timeline

Conversation

@realFlowControl

@realFlowControl realFlowControl commented Oct 13, 2023

Copy link
Copy Markdown
Member

Description

This PR will add reporting of inactivity phases in PHP to the timeline:

  • calling sleep()/usleep() in userland
  • blocking on stream_select(), uv_run(), event_base_loop(), \EventBase\loop() and \EvLoop\run() like you'd do in the ReactPHP or Revolt event loop implementations (AMPHP uses Revolt as its event loop)
  • idle phases between PHP requests like in php-fpm, Apache mod_php or the PHP build-in webserver (php -S)

A thing that is currently open in this PR is this problem:
image
As you can see at the end of the "Main" thread lane, there should also be a grey box indicating and idle phase between requests. Now this box shows up in the next pprof with the idle time being correct. When looking into real world data, this is less of a problem and we might just ignore this for now, especially as the UI handles this pretty well.

PROF-8370

Readiness checklist

  • (only for Members) Changelog has been added to the release document.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.
  • Changelog has been added to the release document. For community contributors the reviewer is in charge of this task.

@realFlowControl realFlowControl added this to the 0.93.0 milestone Oct 13, 2023
@realFlowControl realFlowControl added the profiling Relates to the Continuous Profiler label Oct 13, 2023
@realFlowControl realFlowControl self-assigned this Oct 13, 2023
@morrisonlevi

Copy link
Copy Markdown
Collaborator

First thought on the gap: I would probably move the rshutdown to prshutdown.

@realFlowControl
realFlowControl force-pushed the florian/add-idle-phase-to-timeline branch from 376f41e to 6fa9d8d Compare October 18, 2023 07:11
@pr-commenter

pr-commenter Bot commented Oct 18, 2023

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2023-10-27 15:36:24

Comparing candidate commit 6741590 in PR branch florian/add-idle-phase-to-timeline with baseline commit b3e798f in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 3 unstable metrics.

@realFlowControl
realFlowControl marked this pull request as ready for review October 19, 2023 07:49
@realFlowControl
realFlowControl requested a review from a team as a code owner October 19, 2023 07:49
@realFlowControl
realFlowControl force-pushed the florian/add-idle-phase-to-timeline branch 2 times, most recently from 0b7bc0e to 6c46403 Compare October 23, 2023 20:20
@realFlowControl
realFlowControl requested a review from a team as a code owner October 24, 2023 06:00
@realFlowControl
realFlowControl force-pushed the florian/add-idle-phase-to-timeline branch 2 times, most recently from 595d56f to 1f2b841 Compare October 24, 2023 10:12
@realFlowControl realFlowControl changed the title feat(profiling) add inactivity phases to timeline feat(profiling) add phases of inactivity to timeline Oct 24, 2023
@realFlowControl
realFlowControl force-pushed the florian/add-idle-phase-to-timeline branch from 12febfe to 76babf8 Compare October 27, 2023 08:17
@morrisonlevi

morrisonlevi commented Oct 27, 2023

Copy link
Copy Markdown
Collaborator

We are thinking about splitting this into 2 prs. One adds the inactivity between requests and maybe the sleeps, and then everything else goes into a new PR where we think a bit more critically about what we're really trying to accomplish for those.

@bwoebi bwoebi modified the milestones: 0.93.0, 0.94.0 Oct 28, 2023
@realFlowControl
realFlowControl marked this pull request as draft November 1, 2023 00:23
@realFlowControl realFlowControl removed this from the 0.94.0 milestone Nov 1, 2023
@realFlowControl
realFlowControl deleted the florian/add-idle-phase-to-timeline branch November 12, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants