Comments (3)
Thanks for the suggestions.
Given {active, once}
mode, the larger buffer is essentially unnecessary since there will only be one packet in the buffer at any given time, correct? The typical DNS packet size is 512 bytes, unless EDNS specifies a larger size. Even in that case the typical packet size will still be less than the default 8k size used in Erlang.
So in the current setup the default buffer size is fine.
Now, let's consider if I switched to {active, 100}
. In this case the buffer size would need to be larger. My understanding of {active, N}
, based on http://www.erlang.org/doc/man/inet.html#setopts-2 , I would need to also listen for the {udp_passive, Socket}
message and set {active, N}
again. I'm not sure how much of a gain we'd get by letting the socket buffer, but I may try some testing.
Finally, regarding inet_udp:send
versus gen_udp:send
, are there any drawbacks?
from erldns.
About buffers you are very wrong. This is kernel space reserved for
incomming packets. Nothing to do with active setting.
Once it is full (because they were not processed fast enough) every arrived
udp packet is dropped. I had this problem on every project I used udp in
erlang. It was always filling up.
The difference in inet_udp is that IPs must be in tuple form. That timer is
so that it tries to resolve address in list form. But if it is tuple it
just sets timer, noop then cancel. Unfortunate design.
On Jan 21, 2016 23:31, "Anthony Eden" [email protected] wrote:
Thanks for the suggestions.
Given {active, once} mode, the larger buffer is essentially unnecessary
since there will only be one packet in the buffer at any given time,
correct? The typical DNS packet size is 512 bytes, unless EDNS specifies a
larger size. Even in that case the typical packet size will still be less
than the default 8k size used in Erlang.So in the current setup the default buffer size is fine.
Now, let's consider if I switched to {active, 100}. In this case the
buffer size would need to be larger. My understanding of {active, N},
based on http://www.erlang.org/doc/man/inet.html#setopts-2 , I would need
to also listen for the {udp_passive, Socket} message and set {active, N}
again. I'm not sure how much of a gain we'd get by letting the socket
buffer, but I may try some testing.Finally, regarding inet_udp:send versus gen_udp:send, are there any
drawbacks?—
Reply to this email directly or view it on GitHub
#37 (comment).
from erldns.
Implemented two of the three suggested changes with #61
from erldns.
Related Issues (20)
- mnesia broken HOT 2
- new tag HOT 1
- consul like recursors? HOT 2
- how to DNSSEC HOT 1
- Implement Extended DNS Errors - RFC 8914
- Remove support for delegating failed lookups HOT 3
- Failed to load zones or crashes on queries
- Possible race condition in `zone_cache:put_zone/1`? HOT 2
- move best_match/2 from erldns_resolver to erldns_zone_cache
- AXFR support
- Failed to fetch and copy dep HOT 1
- NAPTR query? HOT 2
- TCP responses should not truncate
- Dead worker process cleanup
- ./rebar: not found HOT 1
- Error starting under OTP 21 due to lager configuration HOT 2
- Two 'Unsupported records' warnings when starting
- Warning related to discrepancy between RRSIG TTL and record TTL HOT 1
- Compilation error on dns_erlang 1.0.0 HOT 3
- Adding multiple json zone files to the config HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erldns.