I keep getting this error very frequent:
Severity: Warning --> mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
This issue gets resolved only after Server restart. Considering this happens over a live server having millions of requests daily, restarting isn't a best option.
[EDITED]
I'm using Ubuntu 18.04 and connecting to an Aurora Cluster on AWS and the backend code resides on EC2
@matigo on Askubuntu seem to think that I might be hitting the limit:
https://askubuntu.com/a/1363447/135086
So I did some debugging to understand if I'm actually hitting that 1024 PPS limit. Luckily there was an AWS article which seems to help me understand that,
https://aws.amazon.com/premiumsupport/knowledge-center/vpc-find-cause-of-failed-dns-queries/
I tried the commands to understand the PPS I'm hitting at the moment and monitored until I find the error.
ERROR - 2021-09-20 12:14:31.547863 --> Severity: Warning --> mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
To my surprise, the following is the output of the command mentioned in the AWS article
tcpdump -r <file_name.pcap> -nn dst port 53 | awk -F " " '{ print $1 }' | cut -d"." -f1 | uniq -c
2 06:44:22
6 06:44:24
4 06:44:26
2 06:44:28
4 06:44:30
7 06:44:34
2 06:44:38
7 06:44:39
9 06:44:44
6 06:44:46
4 06:44:49
6 06:44:50
Considering the timezone as +05:30, an error at 12:14:31 IST should have an entry for dns at 06:44:31 UTC.
If we consider the avg packet size to 4 packets per call, referring to @matigo's answer, I'm not hitting 22 dns calls per second. So further looking into the logs,
4 06:39:06
26 06:39:09
4 06:39:10
2 06:39:13
6 06:39:16
16 06:39:17
Some entries have crossed 22 dns calls per second limit and we didnt encounter the php_network_getaddresses error.
So I'm not sure what the issue is here.
Someone also said this might come due to a rogue DHCP server in the LAN, not sure how to identify that, or would it be possible on an EC2 when the only DNS's configured is the AWS Route53 Resolver.
At this point I'm confused as to if this is even the PPS limit issue or something else.