Repository navigation
image_pipe_server 0.2.0
·
74 commits
to main
since this release
Added
- The
IPS_CONFIG_TOMLenvironment variable holds the whole TOML
configuration, for platforms that can't mount a configuration file.IPS_
setting variables override it as they override the file. Setting both
IPS_CONFIGandIPS_CONFIG_TOMLis an error. - SVG originals and SVG watermarks render like other images. An SVG renders
straight at the size the request needs, so it stays sharp at any size, and
a resize can make it larger than its own size withoutenlarge. Without a
formator a negotiated one, the result is a PNG. [processing.svg]configures SVG rendering:font_dirsand
fallback_familyfor the fonts SVG text renders in (mount a font
directory into the container, since no system fonts are used), and
max_bytes,max_render_work, andmax_render_pixelsto limit the work
an SVG can cause. Afont_dirsentry that doesn't exist, or a file in it
that isn't a font, stops the server from starting.- Logs and traces have an
image_pipe.source.svg_renderspan for each SVG
rendered, with its own and rendered sizes, the estimated work, and the
limit that rejected an SVG. - Caches delete files they can't read, such as ones another ImagePipe
version wrote, once the files are more than an hour old. The
image_pipe.cache.sweepspan reports them asunreadable. - Cache lookup and write spans, and cache stage span events, carry a
cache_keyattribute, the hash of the entry's cache key. Lookup spans also
carryentry(responseorsource_record), and stage events carry
pool(outputorinput). - Cache write log lines and spans carry
bytes, the size of the stored
image, and lookups carry it on a hit for a processed image. Write spans
also carryestimated_cost_us, the work the cache estimates it took to
make the image. - The
image_pipe.requestspan carries arequest_idattribute, the ID
that tags the request's log lines. - Traces have an
image_pipe.source.decode_openspan for each time the
original is opened for decoding.
Changed
- Breaking:
[cache.output]and[cache.input]needmax_size_bytes.
A cache without it stops the server from starting with
cache.output.max_size_bytes: required. Setmax_size_byteson each
cache, below the free space on its volume. - Breaking: Each cache
rootserves one server. The server writes a
.image-pipe-ownerfile into each cache root. While another server keeps
that file updated, the server logs an error and runs without that cache,
and it takes the root over once the other server stops. Give each replica
its own cache volume. A server takes over a root left by a crashed server
on another host about 30 seconds after it starts. - Breaking: A source's
internal_cachetakes"enabled"or
"disabled", and defaults to"enabled". Replace
internal_cache = "auto", which meant the same as"enabled". - Breaking: An
allowed_hostsentry of anhttpsource allows only the
scheme's default port, 80 or 443, including for redirect targets. Add an
entry with the port, such as"assets.example.com:8443", for an origin on
another port. Abase_urlwith a non-default port needs that port in
allowed_hostswhen the list is set. A malformed entry, such as
"assets.example.com:https", stops the server from starting. - Breaking: The
image_pipe.cache.evictiontrace event and the cache
eviction log line reporttriggerasadmissionorstartupinstead ofreconcile. - Processed images and originals cached by an earlier version miss once,
because cache keys and file names changed. The cache refills as requests
come in and deletes the old files. Cache keys now also include the SVG
renderer and the fonts, so changing the fonts or the fallback family makes
cached images miss again. - The cache keeps the images that are requested often and took the most
work to make for their size. At startup it reads only file names, so a
large cache is ready sooner. - Responses no longer wait for the cache volume. A processed image is stored
in the background after it's sent, and a downloaded original while the
request processes it. A request waiting for another request's image or
original stops waiting when it isn't stored 2 seconds after it was sent or
downloaded, and theimage_pipe.cache.coordinationtrace event reports
reasonasdeadline. - When the cache volume can't keep up, writes are dropped instead of queued,
and unfinished writes count againstmax_size_bytes. A write evicts what
it needs before it's stored, so stored images stay under
max_size_bytes. An image larger than a twentieth ofmax_size_bytes, or
256 MiB, is never stored. Each dropped write logsstage_droppedat
warning. - A response to a URL with
expiresdropsstale-while-revalidateand
stale-if-error, because caches can't use them alongside its
must-revalidate. - Each trace span is exported when it ends, not when the request finishes.
- With
trust_traceparent, a request that carries atraceparentheader
follows the caller's sampled flag. Before, it was always exported. - The server uses about 140 MiB less memory: it loads its code when it first
needs it instead of all at startup. SetRELEASE_MODE=embeddedto load
everything at startup. - Before it reports ready, the server processes a small image in each output
format, so the first requests don't wait for the image-processing code to
load or an encoder to start./health/readynow answers503until then, including on the
separatehealth_portlistener. - Images process faster, PNG most of all. The Docker images now ship zlib-ng
2.3.3, libjpeg-turbo 3.2.0 and libpng 1.6.59 in place of Debian's zlib,
libjpeg-turbo and libpng. Across a set of typical requests, latency dropped
by about a quarter, and by more than half for some PNG resizes. - The server handles about 5–10% more images per second when the container
has a CPU limit: the Erlang VM's schedulers no longer spin while they wait
for work, which took CPU that image processing needed. trimis faster on images under a megapixel.- PNG originals, and others that need no shrink-on-load, are opened once
instead of twice. - Uses
image_pipe
0.2.0.
Removed
- Breaking:
node_id,state_dir,flush_interval,
cleanup_interval, andstate_ttlin[cache.output]and
[cache.input]. The cache keeps request counts in memory, so after a
restart it keeps its entries and learns again which are requested most.
Remove the settings, and delete each cache'sstate_dir, by default
.cache_stateunder its root. - Breaking:
eviction_victim_limitandreconcile_intervalin
[cache.output]and[cache.input]. Remove them from your configuration. - Breaking:
window_ratio,sketch_depth,sketch_width,
aging_sample_size,doorkeeper_cardinality,doorkeeper_fpr, and
path_prefixin[cache.output]and[cache.input]. Remove them from
your configuration. The cache no longer reads or cleans up the entries
under apath_prefixdirectory, so delete that directory. - Breaking:
rescan_intervalin[cache.output]and[cache.input],
and theimage_pipe.cache.rescanspan and log line. Remove
rescan_intervalfrom your configuration. A cache deletes leftover files
after its startup scan and then every 24 hours. - Breaking: The
image_pipe.cache.warm_startspan and the cache flush
and cleanup span events. Remove alerts or queries that use them. - Cache stage events no longer report
stage_cleanup_error.
Fixed
- A cache write log line and span report an error when the cache isn't
running, instead of reporting the image as written. - A comma inside a quoted
Acceptparameter, as in
image/webp;x="a,b";q=0, no longer splits the entry and drops theq=0,
so the server no longer chooses a format the client excluded. - With
[http] allow_originset, cross-origin scripts can send conditional
requests such asIf-None-Matchand read headers such asETagand
Content-Disposition. Preflight requests get
Access-Control-Allow-Headers: *, and responses get
Access-Control-Expose-Headers: *. - With
max-bytes, a quality search that ran out of encode attempts ships
the highest encoded quality that fits instead of the lowest. When only the
lowest quality fits,X-ImagePipe-AQ-Outcomeand the logs reporthit. - A
cropplaced withfocuson an image with an EXIF orientation other
than 1 or 5 could land one pixel off when its position fell on a half
pixel. - The source cache stores and reuses originals whose
Cache-Controlhas a
qualifiedprivate="..."orno-cache="..."naming only headers
ImagePipe doesn't keep, such asprivate="Set-Cookie". Before, they were
never stored, or revalidated on every request. - Concurrent fetches from an
httpsource just after startup could fail.
They now wait for the connection pool to start. - A CMYK or other non-RGB source with an embedded color profile and more
pixels thanmax_intermediate_pixelsfails with422, like other
oversized images, instead of415.
Built with image_pipe and image_pipe_url 0.2.0.