Loading…
Topic
Fly.io
53 posts about Fly.io. Every summary links to the original.
- 53 posts
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Serve small with Fly.io and GoStatic
The post shows how to deploy a tiny static signpost site on Fly.io using GoStatic, with the aim of keeping the application’s footprint and running cost low. GoStatic is a self-contained web server that can run in a bare Docker image; the described image is 6MB, while the completed deployment reports 7.7MB. The setup uses fly init examplegostatic -p 8043, a two-line Dockerfile based on pierrezemb/gostatic, and an index.html copied to /srv/http/index.html; Fly routes ports 80 and 443 to GoStatic’s port 8043 and provides HTTPS. After deployment reaches one healthy instance, the post reduces the default micro-2x VM from 512MB RAM to micro-1x, which provides 128MB. This matches the small workload and is presented as a way to reduce running costs.
Flyctl Evolved - Fly Changelog
Flyctl v0.0.137 introduces an app-centric command structure while deprecating the apps subcommand, whose operations now have top-level equivalents such as init, destroy, move, restart, resume, suspend, and list apps. The release changes move, restart, resume, suspend, and status to accept an app name as a final argument, while retaining status -a; list also gains app-name fragments and status or organization filters, and list orgs shows accessible organizations. The init flow offers builders or Dockerfile use, can generate a simple hello-world deployment, and supports --dockerfile to skip the builder query, while info and version gain scripting-oriented output controls. Secret changes block operations on suspended deployments and can monitor deployments unless --detach is used. Platform fixes concatenate multiple HTTP/2 cookie headers during HTTP/1 downcasting, add Via headers to requests and responses, and improve deployment image optimization.
Run Apollo Server Close to Your Users
Run Apollo Server Close to Your Users presents an edge deployment pattern for GraphQL APIs. The post argues that, much like serving JavaScript and markup from a CDN, placing API servers and an application cache near users can improve application speed. Its approach combines Fly.io’s platform for running API servers close to users with a global Redis cache service, then uses Apollo Server’s cache capabilities and first-class Redis support. A demo GraphQL API built from the Open Library REST API accompanies the guide, with both a guide and source code available. The author frames the design through a newly adopted GraphQL perspective, emphasizing static typing and describing the resulting setup as CDN-like infrastructure for an API.
Fly Changelog for 9th June
The 9th June Fly Changelog describes updates to flyctl, Fly platform tooling, and related web sites, centered on installation, application management, monitoring, and Deno builds. New installation instructions support macOS and Linux through a shell script, while a PowerShell command provides native Windows installation and flyctl now installs under $HOME/.fly/bin or configured $FLYCTL_INSTALL/bin. New commands let users restart applications, list accessible apps and organizations with text, organization, and status filters, or resume deployment monitoring with flyctl monitor. The open command accepts a URL path, secret updates automatically start monitoring for redeployment, and upgrade messages move to stderr for CI tooling. The Deno Buildpack now reads configuration from a required .config file, which also allows selecting the Deno version; an empty file is valid, while its absence produces an explanatory error.
WebSockets and Fly
Fly supports WebSocket connections, and the post demonstrates that support with flychat-ws, a small chat application built from raw WebSockets and Express. Deployment requires cloning the example, running npm install, then using flyctl init, flyctl deploy, and flyctl open, with no application-specific configuration changes. Its fly.toml maps internal TCP port 8080 to HTTP port 80 and TLS/HTTP port 443, sets concurrency limits of 20 soft and 25 hard, and checks the service every 10 seconds with a two-second timeout. The Node server broadcasts each received message to every connected client, while the browser selects ws or wss from the served protocol and sends JSON messages. TLS terminates at Fly’s network edge, and the app can also run locally or in Docker.
Mux, Fly, Wocket and RTMP
Wocket is a proof-of-concept application for sending live video from a browser to an RTMP server, potentially avoiding a local encoder such as OBS or Ecamm Live. Built with Next.js and a custom WebSocket server, it captures webcam video, renders it onto a canvas, and uses ffmpeg to support streaming to a Mux live stream through an RTMP ingest URL. The post documents local setup with npm, production commands, and deployment to Fly.io via flyctl and a Dockerfile, while noting that ffmpeg must be available on the PATH. The intended integration uses the MediaRecorder API to send video when dataavailable fires. Mux test streams are limited to five minutes, watermarked, and deleted after 24 hours when no credit card is entered, and the author cautions against relying on the demo for important production workloads.
Fly Changelog May 15th 2020
Fly’s May 15, 2020 changelog records changes to the Fly platform, flyctl, and related websites since the previous update. The main release was a new scaling system based on region pools, accompanied by new scaling commands in flyctl 0.0.122; the earlier autoscale command from version 0.0.121 was removed. The platform also rolled out an HTTP2-only backhaul for traffic between the Fly edge and datacenters, with the changelog reporting improved performance and stability for applications using the http handler. Other entries document new autoscale and regions commands in 0.0.121, consistent naming for flyctl binary artifacts, removal of references to 32-bit Windows and Linux builds during deprecation, and a fix for custom Dockerfile mapping.
Updating Scale
Fly introduces a new scaling model and command set intended to simplify how applications distribute instances across regions and manage global load. Instead of assigning instance counts to a fixed regional list, the system uses a pool of allowed regions plus global minimum and maximum instance counts, with Standard and Balanced models determining placement. Standard distributes instances evenly through the minimum and adds demand-driven instances without relocating them, while Balanced can move instances from other regions once the maximum is reached to match regional demand. The new flyctl regions command manages the pool, and flyctl scale show, standard, balanced, set, and vm commands configure or inspect scaling mode, counts, and VM size. Regional allocation can still fall back to a nearby region when the selected region cannot create an instance.
Fly Answers More Questions
Fly Answers More Questions addresses three Fly usage questions: protection against malicious TCP connections that trigger runaway scaling, dedicated credentials for GitHub Actions, and selecting Dockerfiles in monorepos. For scaling abuse, Fly apps can impose per-region and global instance limits; requests beyond those limits are dropped, while networking protections are already in place. A configurable monthly maximum spend is described as in preview, and usage from an obvious DDoS or similar event may be waived. For continuous deployment, the suggested pattern is a dedicated user with a personal access token, added to a Fly organization so it can deploy to projects. For complex builds, updated flyctl adds deploy's --dockerfile option, allowing a selected Dockerfile instead of the default Dockerfile.
Scaling Fly for All
Fly makes its scaling controls available to all users, allowing them to manage application instance counts across regions and choose virtual-machine sizes. The default plan places an application in one region, while Fly’s autopilot can add an instance when a connection limit of roughly 20–25 is reached and select its location. The new flyctl scale regions command reports or sets regions and per-region minimum counts; for example, ams=1 hkg=1 sjc=1 keeps at least one instance in each location, with weights influencing where new instances are preferred. Users can also run flyctl scale vm to apply a VM size to all current and future instances, triggering a new app version and redeployment. Available sizes range from micro-1x with 128 MB to cpu8mem8 with 8 GB, while the article notes that the system was later superseded.
Fly Friday - Customizing with Dockerfiles
Fly Friday describes how to customize a Docker image before deploying it to Fly, building on an earlier example that deployed Docker’s official httpd image. The default image serves files from /usr/local/apache2/html and displays “It works”; replacing that content requires adding local HTML files to the image. A two-line Dockerfile uses FROM httpd:2.4 as the base and COPY ./public_html/ /usr/local/apache2/htdocs/ to place the contents of a public_html directory into the new image, which Fly then deploys. The post also notes that the directory must be created and populated with HTML, and points to a video and Fly Docs, including a hands-on path to a free account and first app deployment.
Simpler Fly deployments for NodeJS, Rails, Go, and Java
flyctl now supports building and deploying NodeJS, Rails, Go, and Java applications to Fly with two commands. The feature uses Cloud Native Buildpacks from buildpacks.io, turning an application into a Docker image during deployment without requiring users to understand Buildpacks. Cloud Native Buildpacks are described as an evolution of Heroku and Cloud Foundry systems, but are not compatible with their older buildpacks. After installing the latest flyctl, users can initialize an app with flyctl init --builder cloudfoundry/cnb:bionic and run flyctl deploy, then open it with flyctl open. Buildpack support complements Dockerfile-based image builds, while listed builders provide different language coverage and image sizes; the post recommends heroku/buildpacks:18 for its wider coverage.
Turboku - The Art Of Faster Heroku Apps
Turboku is a migration path that automatically turns Heroku web dynos into Fly applications, addressing how existing Heroku apps can move to Fly’s globally distributed edge network. Fly routes requests to the closest datacenter through one global IP address, or two with IPv6, while TLS terminates closer to users and modern ECDSA certificates are automatic for Fly domains. A benchmark around the world used an existing application to compare Heroku and Fly connection stages, full requests, and cached requests. Fly reduced DNS, TCP, TLS, network, and full-request times, with the largest reported improvement appearing when caching was used: 180.16 ms versus Heroku’s 817.75 ms, a 77.91% reduction; uncached full requests fell 35.39%, while TTFB was 1.24% higher.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.