S
S
SexyHair2020-07-17 18:42:49
Docker
SexyHair, 2020-07-17 18:42:49

Sometimes inside docker requests are executed for several seconds, why is this happening?

Container started (image- python:3.8). Inside it, for unknown reasons, requests can take several seconds to complete (I tried curl/requests). Everything is fine on the computer where docker is running. Fulfilled several thousand queries to rule out randomness. If you make requests through requests.Session(), then there are practically no such delays. On the screen, the left terminal is a docker container, the right one is a system one. First, 25 requests are made to Google through requests.Session, then 25 requests through requests. It can be seen that in the container, through requests, some requests are executed for 3 seconds, while in the system, even through requests, requests are completed adequately quickly, without delays of 3 seconds. Why is this happening?
5f11c58028cb8866768220.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-07-19
@SexyHair

Judging by the symptoms, DNS slows down in the docker. When using Session IP, it is checked once and therefore there are no problems, but without sessions, IP is requested with each request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question