New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 672190 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Long delay when connecting to DevTools socket

Project Member Reported by skyos...@chromium.org, Dec 7 2016

Issue description

(from headless-dev@):

> Starting the headless_shell with the switch --remote-debugging-port and
> waiting for the file DevToolsActivePort to be created to start connecting
> to it is not working anymore. The file is created (within 100 to 200 ms) but
> I still have to wait before executing command, the wait time once the file
> is created is around 3 seconds (which before worked straight way).
 

Comment 1 by pnam...@gmail.com, Dec 7 2016

Please find attached the startup trace  (headless_shell is run in the following way headless_shell --trace-startup --trace-startup-file=/tmp/trace_5s.json  --trace-startup-duration=5 --no-sandbox --remote-debugging-port=9222)
trace_5s.json
5.6 MB View Download
Hmm, that trace looks very different from mine (attached). In particular sandbox setup and GPU process initialization seem to take a lot of time. This isn't a debug build, is it?

I made a quick script measuring the connection time and ran it like this:

mkdir -p /tmp/h; for i in $(seq 1 10); do rm -f /tmp/h/DevToolsActivePort; ~/code/chromium/src/out_linux/Release/headless_shell --user-data-dir=/tmp/h --remote-debugging-port=9222 > /dev/null 2>&1 & time inotifywait -qqt 15 -e create -e moved_to /tmp/h; node startup-test.js; kill $!; done

On my machine (HP Z620) total startup time is about 500ms in total, 440ms of which is spent waiting for DevToolsActivePort to get created and 60ms is the time to connect to the socket.
trace_5s.json
373 KB View Download
startup-test.js
320 bytes View Download

Comment 3 by pnam...@gmail.com, Dec 8 2016

The build is not a debug one. It is build with the following arg :
import("//build/args/headless.gn")
is_debug = false 
is_component_build = true
symbol_level = 0
enable_nacl = false
remove_webcore_debug_symbols = true

Comment 4 by pnam...@gmail.com, Dec 9 2016

I have found a way around, when i change the build paramater is_component_build to False, all is working as expected (no long delay to connect to DevTool).
Status: Fixed (was: Available)
Interesting, I'm not sure why a component build would have such a huge effect, but in general non-component builds are recommended for best performance.

Sign in to add a comment