Hello everyone, I have a simple setup with a host and client, where the host has a GET route which just returns some text.
The client uses the python SDK with monkeypatching, here’s the code :
“import os
import openziti
import requests
ztx = openziti.load("ziti/identity.json")
if ztx is None:
raise RuntimeError("Identity load failed")
The code works as expected and returns the intended response, but there is roughly a 10-second delay before the first response. When making multiple requests in a row (with a for loop before requests.get), the same ~10-second delay occurs only for the first request, while all subsequent responses arrive instantly. It seems to me that the delay is caused by the initial setup of the Ziti tunnel, but I don’t have any idea on why it’s the case.
I also can’t manage to have the logs printed with the Python SDK, even when setting ZITI_LOG_LEVEL=debug, so I don’t have more infos.
The same delay applies as well with the example code.
With ZITI_LOG=4, I can see what’s causing the delay. There’s 2 instances :
”(91054)[ 0.001] DEBUG ziti-sdk:ziti_ctrl.c:1106 ctrl_paging_req() ctrl[https://zpix.vigitronic.eu:8440/edge/client/v1\] starting paging request GET[/external-jwt-signers]
(91054)[ 5.064] DEBUG ziti-sdk:ziti_ctrl.c:502 ctrl_body_cb() ctrl[https://zpix.vigitronic.eu:8440/edge/client/v1\] completed GET[/version] in 5.057 s”
this is what (probably) causing the delay. it looks like a slow DNS resolution
What OS are you running on?
can you try hitting controller URL with cURL?
Can you run wireshark or tcpdump to see packet flow for that connection? make sure to capture DNS requests as well
Hey, thanks for your answer.
It was actually due to a DNS problem as you figured.
After a bit of digging, I found that the first DNS address in /etc/resolv.conf was faulty. I’m pretty sure it’s an old, deleted DNS server used when I had the tunneler installed instead of the SDK. It works nicely after removing it
Sorry the issue wasn’t really related to Ziti but thanks for your help and solution!