mhs
Howdy! I’m trying to do a ton of concurrent outbound HTTP efficiently. I’m doing this:
task = fn url ->
Req.new(
url: url,
finch: MyFinch,
max_redirects: 2,
retry: false
)
|> Req.Request.put_header("connection", "close")
|> Req.head()
|> case do
{:ok, response} ->
response.status
{:error, response} ->
:error
end
end
Task.Supervisor.async_stream_nolink(
{:via, PartitionSupervisor, {MyApp.TaskSupervisors, self()}},
urls,
task,
max_concurrency: 1000,
on_timeout: :kill_task,
ordered: false,
timeout: 60000
)
|> Enum.to_list()
At first, processing output looks good, but after ~5 seconds, I start ending up with a ton of:
%Mint.TransportError{reason: :nxdomain}
%Mint.TransportError{reason: :nxdomain}
%Mint.TransportError{reason: :timeout}
%Mint.TransportError{reason: :nxdomain}
%Mint.TransportError{reason: :nxdomain}
%Mint.TransportError{reason: :nxdomain}
%Mint.TransportError{reason: :timeout}
%Mint.TransportError{reason: :timeout}
%Mint.TransportError{reason: :timeout}
Anything bad leap out? The error seems to indicate Mint failing in connect…but…why. At lower volume or the start of a big batch, everything works fine. It’s just as it cranks up heavy it goes sideways.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mhs
My Finch instance looks like this:
dimitarvp
Is the app containerized? The
nxdomainerror often manifests due to problems with the container’s network configuration.mhs
Not containerized.
It’s a
1.14-rc0/OTP 25.0-rc3mix releasebuilt onhexpm/elixir:1.14.0-rc.0-erlang-25.0-rc3-debian-stretch-20210902-slimlocally and deployed on a modest Linux VM (4gb mem, 2.40GHz cpu, Debian Stretch).I have to cross-compile as I’m on a M2 MBP. That was the last
hexpm/elixirDocker image for Stretch and, since this is proof of concept type stuff at the moment, I reached for off the shelf rather than fiddling in making my own new Stretch image.I’ve run the code natively too on my MBP via
iexand observed the same behavior.dimitarvp
Not sure what to recommend, maybe your firewall / router / PiHole? I assume you have tried
curlsuccessfully?mhs
I mean, the work VM def isn’t piholed. And they both start fine but buckle as rate goes sustained high.
I’m starting to mull DNS lookup throttling.
Even Cloudflare might consider thousands of lookups bunched up from a single IP as malicious.
mhs
Yeah, this seems to be outside the BEAM.
Thread starvation + DNS maybe, like this thread talked about:
I’m seeing improvement with an
inetconfiguration file tweaked to{lookup, [dns, native]}.mhs
Hmm, maybe it’s more on the BEAM internal timeslicing side rather than outside in OS or DNS processing. Like, the VM doesn’t process the burst quickly enough so lots of dns resolution mangle.
I can run the same chunk of data in some comperable Rust code on the same host and it resolves everything fine.