Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Forked from Jimmy-Xu/pprof-in-docker-daemon.md
Created January 6, 2021 03:09

Revisions

  1. @Jimmy-Xu Jimmy-Xu revised this gist Jan 21, 2017. 1 changed file with 14 additions and 11 deletions.
    25 changes: 14 additions & 11 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -16,17 +16,20 @@
    > source file: [docker\api\server\profiler.go](https://github.com/docker/docker/blob/master/api/server/profiler.go)
    ```go
    func profilerSetup(mainRouter *mux.Router, path string) {
    var r = mainRouter.PathPrefix(path).Subrouter()
    r.HandleFunc("/vars", expVars)
    r.HandleFunc("/pprof/", pprof.Index)
    r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
    r.HandleFunc("/pprof/profile", pprof.Profile)
    r.HandleFunc("/pprof/symbol", pprof.Symbol)
    r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
    r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
    r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
    r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    const debugPathPrefix = "/debug/"

    func profilerSetup(mainRouter *mux.Router) {
    var r = mainRouter.PathPrefix(debugPathPrefix).Subrouter()
    r.HandleFunc("/vars", expVars)
    r.HandleFunc("/pprof/", pprof.Index)
    r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
    r.HandleFunc("/pprof/profile", pprof.Profile)
    r.HandleFunc("/pprof/symbol", pprof.Symbol)
    r.HandleFunc("/pprof/trace", pprof.Trace)
    r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
    r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
    r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
    r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    }
    ```

  2. @Jimmy-Xu Jimmy-Xu revised this gist Jan 21, 2017. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,17 @@
    #Use pprof debug docker daemon

    - [Use pprof debug docker daemon](#use-pprof-debug-docker-daemon)
    - [pprof debug entrypoint](#pprof-debug-entrypoint)
    - [Start docker daemon in debug mode](#start-docker-daemon-in-debug-mode)
    - [Run socat to make docker sock available via tcp port](#run-socat-to-make-docker-sock-available-via-tcp-port)
    - [Access debug url entrypoint](#access-debug-url-entrypoint)
    - [show global vars](#show-global-vars)
    - [get command line](#get-command-line)
    - [run pprof on your client:](#run-pprof-on-your-client)
    - [generate graph](#generate-graph)
    - [get symbol](#get-symbol)
    - [other](#other)


    # pprof debug entrypoint
    > source file: [docker\api\server\profiler.go](https://github.com/docker/docker/blob/master/api/server/profiler.go)
    @@ -98,6 +99,14 @@ $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    (pprof)
    ```
    ## generate graph
    ```shell
    $ cd /home/xjimmy/pprof
    $ gunzip pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    $ go tool pprof --pdf pprof.dockerd.192.168.1.137:8080.samples.cpu.001.pb > callgraph.pdf
    ```
    ## get symbol
    ```shell
  3. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 55 additions and 45 deletions.
    100 changes: 55 additions & 45 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -4,73 +4,52 @@
    - [Start docker daemon in debug mode](#start-docker-daemon-in-debug-mode)
    - [Run socat to make docker sock available via tcp port](#run-socat-to-make-docker-sock-available-via-tcp-port)
    - [Access debug url entrypoint](#access-debug-url-entrypoint)
    - [run pprof on your client:](#run-pprof-on-your-client)
    - [show global vars](#show-global-vars)
    - [get command line](#get-command-line)
    - [run pprof on your client:](#run-pprof-on-your-client)
    - [get symbol](#get-symbol)
    - [show global vars](#show-global-vars)
    - [other](#other)


    ## pprof debug entrypoint
    # pprof debug entrypoint
    > source file: [docker\api\server\profiler.go](https://github.com/docker/docker/blob/master/api/server/profiler.go)
    ```go
    func profilerSetup(mainRouter *mux.Router, path string) {
    var r = mainRouter.PathPrefix(path).Subrouter()
    r.HandleFunc("/vars", expVars)
    r.HandleFunc("/pprof/", pprof.Index)
    r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
    r.HandleFunc("/pprof/profile", pprof.Profile)
    r.HandleFunc("/pprof/symbol", pprof.Symbol)
    r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
    r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
    r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
    r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    var r = mainRouter.PathPrefix(path).Subrouter()
    r.HandleFunc("/vars", expVars)
    r.HandleFunc("/pprof/", pprof.Index)
    r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
    r.HandleFunc("/pprof/profile", pprof.Profile)
    r.HandleFunc("/pprof/symbol", pprof.Symbol)
    r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
    r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
    r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
    r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    }
    ```

    ## Start docker daemon in debug mode
    # Start docker daemon in debug mode
    > add -D to command line
    ```shell
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
    ```

    ## Run socat to make docker sock available via tcp port
    # Run socat to make docker sock available via tcp port
    > note the IP to listen at
    ```shell
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock
    2016/01/23 12:59:43 socat[3113] N listening on AF=2 192.168.1.137:8080
    ```

    ## Access debug url entrypoint
    ### run pprof on your client:
    ```shell
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    ```
    # Access debug url entrypoint

    ### get command line
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```

    ### get symbol
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/symbol
    num_symbols: 1
    ```

    ### show global vars
    ## show global vars

    ```json
    ```js
    $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    {
    "cmdline": [
    @@ -96,10 +75,41 @@ $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    "Mallocs": 313164,
    "Frees": 199260,
    "HeapAlloc": 7140904,
    "HeapSys": 11124736,
    "HeapIdle": 1720320,
    "HeapInuse": 9404416,
    "HeapReleased": 1687552,
    "HeapObjects": 113904,
    ...
    ```
    ## get command line
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```
    ## run pprof on your client:
    ```shell
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    ```
    ## get symbol
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/symbol
    num_symbols: 1
    ```
    ## other
    ```
    $ culr -s http://192.168.1.137:8080/debug/pprof/block
    $ curl -s http://192.168.1.137:8080/debug/pprof/heap
    $ curl -s http://192.168.1.137:8080/debug/pprof/goroutine
    $ curl -s http://192.168.1.137:8080/debug/pprof/threadcreate
    ```
  4. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@


    ## pprof debug entrypoint
    > source file: docker\api\server\profiler.go
    > source file: [docker\api\server\profiler.go](https://github.com/docker/docker/blob/master/api/server/profiler.go)
    ```go
    func profilerSetup(mainRouter *mux.Router, path string) {
  5. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 41 additions and 16 deletions.
    57 changes: 41 additions & 16 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -1,51 +1,76 @@
    #Use pprof debug docker daemon

    - [Start docker daemon in debug mode(add -D)](#start-docker-daemon-in-debug-modeadd-d)
    - [Run socat to make docker sock available via tcp port (note the IP to listen at)](#run-socat-to-make-docker-sock-available-via-tcp-port-note-the-ip-to-listen-at)
    - [pprof debug entrypoint](#pprof-debug-entrypoint)
    - [Start docker daemon in debug mode](#start-docker-daemon-in-debug-mode)
    - [Run socat to make docker sock available via tcp port](#run-socat-to-make-docker-sock-available-via-tcp-port)
    - [Access debug url entrypoint](#access-debug-url-entrypoint)
    - [run pprof on your client:](#run-pprof-on-your-client)
    - [get command line](#get-command-line)
    - [get symbol](#get-symbol)
    - [show global vars](#show-global-vars)


    ## Start docker daemon in debug mode(add -D)
    ## pprof debug entrypoint
    > source file: docker\api\server\profiler.go
    ```go
    func profilerSetup(mainRouter *mux.Router, path string) {
    var r = mainRouter.PathPrefix(path).Subrouter()
    r.HandleFunc("/vars", expVars)
    r.HandleFunc("/pprof/", pprof.Index)
    r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
    r.HandleFunc("/pprof/profile", pprof.Profile)
    r.HandleFunc("/pprof/symbol", pprof.Symbol)
    r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
    r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
    r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
    r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    }
    ```

    ## Start docker daemon in debug mode
    > add -D to command line
    ```shell
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
    ```

    ## Run socat to make docker sock available via tcp port (note the IP to listen at)
    ```
    ## Run socat to make docker sock available via tcp port
    > note the IP to listen at
    ```shell
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock
    2016/01/23 12:59:43 socat[3113] N listening on AF=2 192.168.1.137:8080
    ```

    ## Access debug url entrypoint
    ### run pprof on your client:
    ```
    ```shell
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    ```

    ### get command line
    ```
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```

    ### get symbol
    ```
    ```shell
    $ curl -s http://192.168.1.137:8080/debug/pprof/symbol
    num_symbols: 1
    ```

    ### show global vars
    ```

    ```json
    $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    {
    "cmdline": [
  6. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 26 additions and 11 deletions.
    37 changes: 26 additions & 11 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,26 @@
    #use pprof debug docker daemon
    #Use pprof debug docker daemon

    ##Start docker daemon in debug mode(add -D)
    - [Start docker daemon in debug mode(add -D)](#start-docker-daemon-in-debug-modeadd-d)
    - [Run socat to make docker sock available via tcp port (note the IP to listen at)](#run-socat-to-make-docker-sock-available-via-tcp-port-note-the-ip-to-listen-at)
    - [Access debug url entrypoint](#access-debug-url-entrypoint)
    - [run pprof on your client:](#run-pprof-on-your-client)
    - [get command line](#get-command-line)
    - [get symbol](#get-symbol)
    - [show global vars](#show-global-vars)


    ## Start docker daemon in debug mode(add -D)
    ```
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
    ```

    ##Run socat to make docker sock available via tcp port (note the IP to listen at)
    ## Run socat to make docker sock available via tcp port (note the IP to listen at)
    ```
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock
    ```

    ##Run pprof on your client:
    ## Access debug url entrypoint
    ### run pprof on your client:
    ```
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    @@ -22,7 +32,18 @@ Entering interactive mode (type "help" for commands)
    (pprof)
    ```

    ##debug url entrypoint
    ### get command line
    ```
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```

    ### get symbol
    ```
    $ curl -s http://192.168.1.137:8080/debug/pprof/symbol
    num_symbols: 1
    ```

    ### show global vars
    ```
    $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    @@ -57,9 +78,3 @@ $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    "HeapObjects": 113904,
    ...
    ```

    ### get command line
    ```
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```
  7. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ Entering interactive mode (type "help" for commands)
    ##debug url entrypoint
    ### show global vars
    ```
    $ curl -s http://192.168.1.137:8080/debug/vars
    $ curl -s http://192.168.1.137:8080/debug/vars | jq .
    {
    "cmdline": [
    "/usr/bin/docker",
  8. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -61,5 +61,5 @@ $ curl -s http://192.168.1.137:8080/debug/vars
    ### get command line
    ```
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/dockerdaemon-D-Htcp://0.0.0.0:2375-Hunix:///var/run/docker.sock-api-enable-cors--storage-driver=aufs--insecure-registryregistry.hyper.sh:5000--insecure-registry192.168.1.137:5000
    /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -api-enable-cors --storage-driver=aufs --insecure-registry registry.hyper.sh:5000 --insecure-registry 192.168.1.137:5000
    ```
  9. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 47 additions and 3 deletions.
    50 changes: 47 additions & 3 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,16 @@
    #Start docker daemon in debug mode(add -D)
    #use pprof debug docker daemon

    ##Start docker daemon in debug mode(add -D)
    ```
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
    ```

    #Run socat to make docker sock available via tcp port (note the IP to listen at)
    ##Run socat to make docker sock available via tcp port (note the IP to listen at)
    ```
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock
    ```

    #Run pprof on your client:
    ##Run pprof on your client:
    ```
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    @@ -18,4 +20,46 @@ Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    ```

    ##debug url entrypoint
    ### show global vars
    ```
    $ curl -s http://192.168.1.137:8080/debug/vars
    {
    "cmdline": [
    "/usr/bin/docker",
    "daemon",
    "-D",
    "-H",
    "tcp://0.0.0.0:2375",
    "-H",
    "unix:///var/run/docker.sock",
    "-api-enable-cors",
    "--storage-driver=aufs",
    "--insecure-registry",
    "registry.hyper.sh:5000",
    "--insecure-registry",
    "192.168.1.137:5000"
    ],
    "memstats": {
    "Alloc": 7140904,
    "TotalAlloc": 20379824,
    "Sys": 14559480,
    "Lookups": 3090,
    "Mallocs": 313164,
    "Frees": 199260,
    "HeapAlloc": 7140904,
    "HeapSys": 11124736,
    "HeapIdle": 1720320,
    "HeapInuse": 9404416,
    "HeapReleased": 1687552,
    "HeapObjects": 113904,
    ...
    ```

    ### get command line
    ```
    $ curl -s http://192.168.1.137:8080/debug/pprof/cmdline
    /usr/bin/dockerdaemon-D-Htcp://0.0.0.0:2375-Hunix:///var/run/docker.sock-api-enable-cors--storage-driver=aufs--insecure-registryregistry.hyper.sh:5000--insecure-registry192.168.1.137:5000
    ```
  10. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 2 changed files with 21 additions and 15 deletions.
    15 changes: 0 additions & 15 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,15 +0,0 @@
    Start docker daemon in debug mode(add -D)
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

    Run socat to make docker sock available via tcp port (note the IP to listen at)
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock

    Run pprof on your client:
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    21 changes: 21 additions & 0 deletions pprof-in-docker-daemon.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #Start docker daemon in debug mode(add -D)
    ```
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
    ```

    #Run socat to make docker sock available via tcp port (note the IP to listen at)
    ```
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock
    ```

    #Run pprof on your client:
    ```
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    ```
  11. @Jimmy-Xu Jimmy-Xu revised this gist Jan 23, 2016. 1 changed file with 11 additions and 11 deletions.
    22 changes: 11 additions & 11 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    Enable port 8080 through the firewall:
    firewall-cmd --add-port=8080/tcp
    Start docker daemon in debug mode(add -D)
    $ /usr/bin/docker daemon -D -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

    Run socat to make docker sock available via tcp port (note the IP to listen at)
    socat -d -d TCP-LISTEN:8080,fork,bind=192.168.122.214 UNIX:/var/run/docker.sock
    $ socat -d -d TCP-LISTEN:8080,fork,bind=192.168.1.137 UNIX:/var/run/docker.sock

    Run pprof on your client:
    go tool pprof http://192.168.122.214:8080/debug/pprof/profile
    Fetching profile from http://192.168.122.214:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/kir/pprof/pprof.192.168.122.214:8080.samples.cpu.002.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
    $ go tool pprof http://192.168.1.137:8080/debug/pprof/profile
    Fetching profile from http://192.168.1.137:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/xjimmy/pprof/pprof.192.168.1.137:8080.samples.cpu.001.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)
  12. @kolyshkin kolyshkin created this gist Aug 12, 2015.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    Enable port 8080 through the firewall:
    firewall-cmd --add-port=8080/tcp

    Run socat to make docker sock available via tcp port (note the IP to listen at)
    socat -d -d TCP-LISTEN:8080,fork,bind=192.168.122.214 UNIX:/var/run/docker.sock

    Run pprof on your client:
    go tool pprof http://192.168.122.214:8080/debug/pprof/profile
    Fetching profile from http://192.168.122.214:8080/debug/pprof/profile
    Please wait... (30s)
    Saved profile in /home/kir/pprof/pprof.192.168.122.214:8080.samples.cpu.002.pb.gz
    Entering interactive mode (type "help" for commands)
    (pprof) web
    (pprof) web ploop
    (pprof)