shawn1m / overture

A customized DNS relay server
MIT License
1.79k stars 284 forks source link

Please optimize overture to use CPU #192

Open liang-hiwin opened 4 years ago

liang-hiwin commented 4 years ago

Overture occupies a lot of cpu, the cpu is 100% less than 1 minute after starting overture, sometimes i / o times out

funnypc commented 4 years ago

not sure if it's same issue, but observed high cpu loading occasionally for overture-linux-arm64 running on android pie, overture keep outputing 'Failed to connect to DNS-over-TLS upstream' until system reboot seems overture trapped in high cpu loop when encounter tls connection drop.

log attached (all AlternativeDNS are DoT servers, based on ip/domain filter scheme)

time="2019-12-10 01:11:11" level=info msg="Overture v1.6-rc6" time="2019-12-10 01:11:11" level=info msg="If you need any help, please visit the project repository: https://github.com/shawn1m/overture" time="2019-12-10 01:11:11" level=info msg="Domain TTL file ./domain_ttl_sample has been loaded with 1 records (0 failed)" time="2019-12-10 01:11:11" level=info msg="Domain file ./domain_primary_sample has been loaded with 1 records (regex-list)" time="2019-12-10 01:11:11" level=info msg="Domain file ./fullgfwlist.acl has been loaded with 5716 records (regex-list)" time="2019-12-10 01:11:11" level=info msg="IP network file ./china_ip_list.txt has been loaded with 5694 records" time="2019-12-10 01:11:11" level=warning msg="No element has been loaded from IP network file: ./ip_network_alternative_sample" time="2019-12-10 01:11:11" level=info msg="Minimum TTL is disabled" time="2019-12-10 01:11:11" level=info msg="CacheSize is 500" time="2019-12-10 01:11:11" level=info msg="Hosts file has been loaded successfully" time="2019-12-10 01:11:11" level=info msg="Overture is listening on :5354" time="2019-12-10 01:11:37" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:11:38" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:11:40" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...repeat... time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:40719->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:40877->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:01" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...repeat... time="2019-12-10 01:12:13" level=warning msg="CloudFlare Fail: Send question message failed" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:41081->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Google Fail: Send question message failed" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...

liang-hiwin commented 4 years ago

not sure if it's same issue, but observed high cpu loading occasionally for overture-linux-arm64 running on android pie, overture keep outputing 'Failed to connect to DNS-over-TLS upstream' until system reboot seems overture trapped in high cpu loop when encounter tls connection drop.

log attached (all AlternativeDNS are DoT servers, based on ip/domain filter scheme)

time="2019-12-10 01:11:11" level=info msg="Overture v1.6-rc6" time="2019-12-10 01:11:11" level=info msg="If you need any help, please visit the project repository: https://github.com/shawn1m/overture" time="2019-12-10 01:11:11" level=info msg="Domain TTL file ./domain_ttl_sample has been loaded with 1 records (0 failed)" time="2019-12-10 01:11:11" level=info msg="Domain file ./domain_primary_sample has been loaded with 1 records (regex-list)" time="2019-12-10 01:11:11" level=info msg="Domain file ./fullgfwlist.acl has been loaded with 5716 records (regex-list)" time="2019-12-10 01:11:11" level=info msg="IP network file ./china_ip_list.txt has been loaded with 5694 records" time="2019-12-10 01:11:11" level=warning msg="No element has been loaded from IP network file: ./ip_network_alternative_sample" time="2019-12-10 01:11:11" level=info msg="Minimum TTL is disabled" time="2019-12-10 01:11:11" level=info msg="CacheSize is 500" time="2019-12-10 01:11:11" level=info msg="Hosts file has been loaded successfully" time="2019-12-10 01:11:11" level=info msg="Overture is listening on :5354" time="2019-12-10 01:11:37" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:11:38" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:11:40" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...repeat... time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:40719->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:40877->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:00" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:01" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...repeat... time="2019-12-10 01:12:13" level=warning msg="CloudFlare Fail: Send question message failed" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: write tcp 172.19.0.1:41081->9.9.9.10:853: write: broken pipe" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:14" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Google Fail: Send question message failed" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" time="2019-12-10 01:12:15" level=warning msg="Failed to connect to DNS-over-TLS upstream: EOF" ...

Yes, sometimes it happens to me.

shawn1m commented 4 years ago

I never use overture on arm devices in the real world and I'm not an "DNS-over-TLS" user at all. So if someone could reproduce this bug and fix it I will be appreciate.