~/talk

The Perils of Large Files

Talkat ElixirConf EU Virtual 2020 · 2020-10-07..10-08· [web-performance, databases]
slides:none on file

Shows concrete failures and fixes: reading a 128MB PDF into a long‑lived GenServer holds reference‑counted binaries and raises memory by ~166MB unless the process hibernates or caller reads the path; hashing with a naive read balloons memory but switching to FastStream with 8MB chunks keeps memory low; fetching a 12MB file via httpc can spike ~300–350MB, solved by a streaming receive loop and direct file writes or using httpc raw mode; recommends recon binary_leak, telemetry and soak testing to catch leaks.

AI-written summary · about

  1. 0:00Intro
  2. 0:37TL;DR on PDF files • PDFs can be variable in size (20KB to 1+GB) Can be extremely complex/expensive to render
  3. 3:49Danger! • Memory starvation • Memory leaks • CPU/O starvation when operating on the file contents
  4. 5:28Out of scope for this talk • A one-size, fits-all solution A packaged library and/or large snippets
  5. 6:19Reading files • We have a file-system based cache store . Read the file by name • Process controls filesystem location
  6. 13:52Processing files . Given a file, we want to calculate its sha256 sum
  7. 19:21Writing files . Given a URL, fetch it and write the response to a file
  8. 27:08Limitations of raw mode Without intermediary process, we need to manually clos the io device with File.close/1 Only works on the same node
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.