Docker:How to get exact time the Docker host receives the request & exact time the Docker container receives the request in docker?

I have a Django application running inside docker container. But because of some reason my application became very slow. I want to use profiling to my application.

For that I check with Apache & nginx logs.Then want to get more picture on this.How to get the exact time the docker host receives the request & exact time docker container receives the request.

  • In Docker, can I use the JSON format for entrypoint from the command line?
  • COPY with docker but with exclusion
  • Setting Up Docker Dnsmasq
  • How do I run 2 environments of SkyDns/Skydock simultaneously?
  • What does docker use for (image) versioning?
  • Spring boot docker plugin requires removing the image everytime
  • Any help will be awesome!!!

  • Docker create a test machine
  • How does the onbuild directory work for the offical Rails docker image?
  • Creating a container that runs IBM Containers Extension (ICE)
  • Spark Docker - Can't access web UI for resource manager - Mac PC
  • Jenkins not able to access internet when running as docker container
  • How to configure log-driver in kubernetes pods file?
  • One Solution collect form web for “Docker:How to get exact time the Docker host receives the request & exact time the Docker container receives the request in docker?”

    The way I have seen this work in the past is to add a custom header with the current timestamp including milliseconds to each request as you are reverse proxying the requests. In your case this would be done on your nginx config. Something like this

    proxy_set_header X-Request-Start "t=${msec}";

    Then on the Apache side before it process the request you can do the same thing.

    For Apache

    RequestHeader set X-Request-Start-2 "%t"

    You could even record when the response is finished and have 3 points in time to compare.

    Then in your logs, or django, or in your metrics gathering system, you can compare the time between the points to find out how long it takes to go from nginx to Apache, and that is the request queue time. It should be pretty fast, but if Apache isn’t tuned correctly it is possible the requests are getting queued while waiting for others to get processed.

    You can use something like new relic who can scope out all the details of the request and show you the results in a pretty graph. They even have a free version that does what you are looking for, and they support docker.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.