Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Zero-downtime Rails deployment on a VPS comes from coordinating three things: immutable, timestamped releases; Puma workers replaced without closing the listening socket; and database changes that remain compatible while old and new code run together. Run Puma in the foreground under systemd, put NGINX in front when you need TLS or static-file serving, prepare each release completely before switching a stable current symlink, then use Puma’s phased restart rather than a normal service restart.

What zero-downtime Rails deployment means

A deployment is effectively zero-downtime when requests continue to receive responses while a new release is installed and activated. It does not mean that every request is guaranteed to succeed: a bad release, an incompatible migration, exhausted memory, or an unrelated infrastructure failure can still produce errors. The goal is to avoid the predictable outage caused by stopping the only application process, replacing files in place, and waiting for Rails to boot again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical VPS request path is:

client → NGINX (TLS and optional static files) → Puma Unix socket → Rails

NGINX is an implementation choice, not a requirement of Puma. You can expose Puma through another proxy or directly, but NGINX is commonly useful for TLS termination and efficient delivery of fingerprinted assets. Rails’ deployment guidance also documents long-lived cache headers for compiled assets.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

The release layout that makes safe cutovers possible

Never deploy by overwriting the directory from which the running process is serving code. Instead, create a new, timestamped release and change one stable symlink only after that release passes preparation checks.

/var/www/myapp/
├── current -> releases/20261015040100
├── releases/
│   ├── 20261015040100/
│   └── 20261014183000/
└── shared/
    ├── config/
    ├── log/
    ├── tmp/pids/
    ├── sockets/
    ├── cache/
    └── uploads/

The timestamp is an example; generate it from the deployment time. The current link is the only path systemd and Puma need to follow. Each release contains the checked-out application, its bundled Ruby dependencies, and compiled assets. Runtime data that must survive a release switch belongs in shared.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What belongs in shared storage

  • Secrets and configuration: production credentials, database configuration, and environment files that are not committed to the repository.
  • Logs: Rails and other application logs, so rotation and diagnosis continue across releases.
  • Runtime state: Puma’s PID and state files and its Unix socket directory.
  • Cache: only caches that should survive a release; ephemeral caches can remain release-local.
  • Uploads: user files and other persistent content that must not disappear when an old release is removed.

Capistrano Rails supports this pattern with linked files and directories, and exposes deployment tasks for assets and migrations. Whether you use Capistrano or a custom script, the invariant is the same: create links before booting the new release, and do not store persistent user data inside a disposable release directory.

Choose Puma’s process model and concurrency deliberately

Use Puma cluster mode when the VPS has more than one CPU core so multiple worker processes can use the available CPU. Single mode is generally suited to a fully multithreaded Ruby implementation or an MRI host with only one CPU core. These are starting points, not capacity guarantees.

Set worker and thread counts from measured CPU and memory capacity. Every worker loads application code and consumes memory; every thread can increase concurrent database and external-service work. Load-test the application before increasing either value, and check the database connection pool against the maximum simultaneous Rails threads.

Example Puma configuration

The following values are illustrative. Replace them after measuring the VPS and application:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
workers Integer(ENV.fetch("WEB_CONCURRENCY", 2))
threads_count = Integer(ENV.fetch("RAILS_MAX_THREADS", 5))
threads threads_count, threads_count
preload_app!
plugin :tmp_restart

bind "unix:///var/www/myapp/shared/sockets/puma.sock"
pidfile "/var/www/myapp/shared/tmp/pids/puma.pid"
state_path "/var/www/myapp/shared/tmp/pids/puma.state"

environment ENV.fetch("RAILS_ENV", "production")

The Unix socket path is outside the release, so it remains valid when current changes. The PID and state paths use the same principle. plugin :tmp_restart enables Puma’s temporary-file restart mechanism; it is not a substitute for the phased restart command used by the deployment process.

Understand preload_app! before enabling it

Preloading boots the application before Puma forks workers and can reduce duplicated memory through copy-on-write. It can also expose initialization code that is not safe across a fork. Validate database, cache, and other client reconnection hooks for your application before enabling it. The configuration above shows the option, not a claim that every Rails application can use it unchanged.

Run Puma as a supervised foreground service

Puma’s deployment guidance recommends an operating-system process monitor such as systemd and does not require daemonization for zero-downtime restarts. Keep Puma in the foreground so systemd can observe readiness, restart a crashed process, and collect logs.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Example systemd unit

[Unit]
Description=MyApp Puma
After=network.target

[Service]
Type=notify
User=deploy
WorkingDirectory=/var/www/myapp/current
ExecStart=/var/www/myapp/current/bin/puma -C /var/www/myapp/current/config/puma.rb
Restart=always
RestartSec=5
WatchdogSec=10

[Install]
WantedBy=multi-user.target

Change the user, paths, and Ruby environment to match the VPS. If Ruby is installed through a version manager, use an executable path and environment that systemd can actually resolve; interactive shell initialization files are not automatically loaded for a system service.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puma 5.1 and later support Type=notify and watchdog integration when the required notification support is available. If your Puma build or service environment cannot send readiness notifications, use a service type and watchdog setup supported by that host rather than claiming readiness that systemd cannot receive.

Enable and validate the unit

  1. Save the unit as /etc/systemd/system/myapp-puma.service.
  2. Reload unit files: sudo systemctl daemon-reload.
  3. Enable it at boot: sudo systemctl enable myapp-puma.
  4. Start it: sudo systemctl start myapp-puma.
  5. Inspect status: sudo systemctl status myapp-puma.
  6. Read recent logs: sudo journalctl -u myapp-puma -n 100 --no-pager.

Before the first production deployment, confirm that the socket exists, Puma’s workers remain running, and a health endpoint returns the expected response. A service that is “active” but cannot accept requests is not ready for a cutover.

Socket activation as an alternative restart boundary

Puma documents socket activation as an option in which systemd keeps the listening socket open while the service is restarted. This can provide a hot-restart boundary, but it is a different setup from a conventional Puma-owned socket and requires matching systemd and Puma configuration. Do not enable it casually on a service that was configured to bind the socket itself.

Prepare NGINX and the health path

Point NGINX at the shared Puma socket and configure TLS, request limits, and timeouts for your application. Keep the proxy configuration independent of release directories; the socket path should remain /var/www/myapp/shared/sockets/puma.sock.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Serve fingerprinted files directly from the release or a shared asset location only when your cleanup policy preserves files still referenced by browsers and caches. Rails production precompilation writes compiled assets to public/assets. A typical NGINX rule gives /assets/ a one-year expiry and Cache-Control: public; use long caching only with digest-named files so a new asset has a new URL.

Expose a lightweight health endpoint that checks application boot and, if appropriate, a basic database query. Keep deep third-party checks out of the readiness path if a temporary outage of that dependency would unnecessarily remove healthy web workers from service.

The deployment sequence, step by step

The order matters. Build everything possible before changing the pointer that serves traffic.

1. Create a new release directory

Fetch the exact commit or artifact into a directory such as /var/www/myapp/releases/20261015040100. Do not modify the release after the cutover begins. Recording the commit, bundle lockfile, and deployment timestamp makes rollback and diagnosis unambiguous.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

2. Install locked dependencies

Run Bundler in deployment mode using the lockfile. Install any required JavaScript dependencies using the project’s locked manifest and package manager. Fail the deployment if dependency installation fails; a partial bundle is not a deployable release.

3. Link shared files and directories

Create links from the new release to shared credentials, database configuration, logs, temporary runtime directories, the socket directory, cache locations, and uploads. Verify ownership and permissions as the deploy user before asking Puma to boot.

4. Precompile production assets

RAILS_ENV=production bin/rails assets:precompile

Production precompilation is normally part of deployment. If the build does not need production secrets, Rails documents the use of SECRET_KEY_BASE_DUMMY for that build step. Do not replace real runtime credentials with the dummy value in the running application.

5. Apply only compatible migrations

Run migrations before cutover only when the old release can continue operating against the resulting schema. Capistrano Rails exposes a deploy:migrate task and supports conditional migration configuration, but the safety decision remains application-specific. A migration that blocks writes for a long time needs its own maintenance and lock-time plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Boot-check the new release

Run the application’s checks against the new directory before changing current. Check that Rails can load, credentials decrypt, the database connection works, assets exist, and the health endpoint responds. You can start a temporary process on an internal port or use the same service configuration in a controlled validation step; do not expose an unverified release to the public socket.

7. Atomically switch the current link

Create a temporary symlink and rename it over the old one so readers see either the old or new target, never a half-written path:

ln -s /var/www/myapp/releases/20261015040100 /var/www/myapp/current.new
mv -Tf /var/www/myapp/current.new /var/www/myapp/current

The exact rename flags can vary by operating system; verify the result with readlink -f /var/www/myapp/current. Keep the previous release directory until the new version has passed production checks.

8. Request a Puma phased restart

Use Puma’s control mechanism or send SIGUSR1 to request a phased restart. Puma replaces workers one at a time, waits for each new worker to start, and leaves the master process running. The listening socket remains available, so requests can continue while workers are replaced.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The precise control command depends on how the control server and state file are configured. Confirm the command in the Puma version installed on the VPS rather than copying a control URL or secret from another deployment.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

9. Verify the live release

  • Request the public health endpoint through NGINX.
  • Check that the response identifies the intended release or commit where your application exposes that safely.
  • Watch journalctl -u myapp-puma and Rails logs for boot exceptions, connection errors, and repeated worker exits.
  • Load a page containing fingerprinted CSS and JavaScript and confirm the asset URLs return successfully.
  • Review error rate, latency, queue depth, and database saturation using the monitoring already available on the VPS.

Why a normal systemctl restart can cause an outage

A normal service restart stops Puma and closes its listener while the replacement process initializes. During that interval NGINX has no application socket to forward to. If a request-serving gap is unacceptable, do not use systemctl restart myapp-puma as the normal code-deploy operation.

Method Request continuity Old and new code overlap Database requirement Memory and complexity
Normal systemd restart Listener closes while the new process boots; a gap is possible No intentional overlap Still must be compatible with any in-flight requests Lowest operational complexity; unsuitable where a gap is unacceptable
Puma phased restart Workers are replaced one by one while the master and socket remain Yes, old and new workers coexist briefly Schema must support both versions during overlap Needs extra memory for overlapping workers and careful migration design
Puma hot restart Designed to replace the process, but behavior depends on socket handoff configuration Short process transition Code and schema still need compatibility during in-flight work More setup-sensitive than phased restart
systemd socket-activated restart systemd holds the listening socket while Puma is restarted Usually a process transition rather than worker-by-worker overlap Plan for requests handled across the transition Requires coordinated socket-activation configuration
Blue-green deployment Traffic switches between two complete environments Yes, entire stacks overlap Shared database must support both releases Fast rollback, but substantially higher infrastructure and memory cost

Puma’s phased restart is usually the smallest change that delivers worker-by-worker replacement on one VPS. It is not magic isolation: old and new processes genuinely exist at the same time, so code, jobs, serialized data, and database schema must tolerate that period.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Design migrations for overlapping workers

The most common zero-downtime failure is a migration that makes the old release invalid before the phased restart has replaced every worker. Use an expand-and-contract sequence.

Expand

Add the new table, column, index, or constraint in a way that does not break old queries. New columns are typically introduced as nullable or with an application-safe default. Avoid making an old worker write a value it does not know about, and consider whether an index build can lock a busy table.

Deploy compatibility code

Release code that can read the old and new shapes and, where necessary, writes both representations. Feature flags can keep the new path disabled while the schema change propagates.

Backfill separately

Backfill large datasets in controlled batches rather than turning a deploy migration into an unbounded transaction. Monitor lock waits, replication or backup impact, and application latency. Puma replacing workers does not shorten a database lock or make a blocking migration safe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Switch behavior

After all workers understand the expanded schema and the backfill is complete, switch reads and writes to the new representation. Keep the compatibility path until the rollback window and every old worker have passed.

Contract later

Only in a later deployment remove obsolete columns, tables, or dual-write code. Destructive migrations make rollback unsafe unless you have a separate recovery plan; pointing current back to old code cannot restore a column that has been dropped.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Assets, caches, and browser behavior during a release

Digest-named assets let old HTML continue requesting the files it referenced while a new release is being prepared. Do not delete the previous release’s compiled assets immediately after cutover. A browser or intermediary cache can hold an old page for longer than the deployment itself.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

If assets are stored in a shared directory, make cleanup age-aware and retain every file that an active or recently active release may reference. If assets remain inside each release, retain the previous release until caches have naturally aged and your rollback window closes. Uploads require a separate persistent location; they are not compiled assets and must never be removed by release cleanup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Rollback without making the database worse

Failure before cutover

If dependency installation, asset compilation, migration compatibility checks, or boot checks fail, leave current pointing at the previous release. Inspect journalctl -u myapp-puma and the release-specific logs, fix the problem, and discard only the unactivated release after preserving diagnostics.

Failure after cutover

If the pointer changed but the health check or error rate is unacceptable, point current back to the previous release and perform another phased restart. Verify the public endpoint and logs before declaring recovery.

Database limits on rollback

A code rollback is safe only while the database schema and stored data remain readable by the previous release. Additive, backward-compatible migrations usually preserve that option. Destructive changes, irreversible data transformations, or code that permanently writes a new format require a separately planned recovery path.

Operational checklist

  • Confirm the VPS has enough memory for old and new workers to overlap.
  • Check the Ruby, Bundler, Node or JavaScript toolchain, and Puma versions used by the release.
  • Verify systemd can find the Ruby and Puma executables without an interactive shell.
  • Ensure shared secrets, logs, sockets, PID files, caches, and uploads have correct ownership.
  • Run asset precompilation and boot checks before changing current.
  • Classify every migration as safe for old workers, and schedule long locks separately.
  • Confirm NGINX points to the shared socket and serves the intended asset path.
  • Use phased restart for code deployment; reserve a normal restart for maintenance where a brief gap is acceptable.
  • Keep the previous release and its assets until health, logs, and rollback checks are complete.
  • Record the deployed commit, migration version, and release directory for incident response.

Troubleshooting common failures

Systemd reports an immediate exit

Check the executable path, working directory, Ruby environment, file permissions, and missing environment variables. Read the complete unit log with journalctl -u myapp-puma -b. A path that works in your shell may fail under systemd because shell profile files are not loaded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

NGINX returns a gateway error

Confirm Puma is running, the shared socket exists, and both NGINX and the deploy user can traverse the parent directories. Check that NGINX’s upstream path exactly matches Puma’s bind path and that a phased restart did not leave stale socket ownership.

New workers crash while old workers remain healthy

Inspect Puma and Rails logs for missing secrets, incompatible initializers, failed database connections, or an asset manifest mismatch. Because phased restart proceeds worker by worker, a crash can leave a mixed fleet; stop the deployment, restore the previous pointer if necessary, and fix the release before trying again.

Old pages report missing assets

Retain the previous digest-named files, check NGINX’s asset root and cache headers, and inspect the exact URL requested by the browser. Do not remove old assets as part of the same command that deletes an old release.

A migration blocks traffic

Do not assume worker replacement solves a database lock. Cancel or pause the migration according to your database’s safety procedures, restore application compatibility, and redesign the change as an online expand-and-contract operation with a separately monitored backfill.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A repeatable deployment algorithm

  1. Build and identify a new timestamped release.
  2. Install locked dependencies and link shared runtime files.
  3. Compile production assets.
  4. Apply only migrations that both releases can tolerate.
  5. Run boot and health checks against the new release.
  6. Atomically move current to the prepared directory.
  7. Trigger Puma’s phased restart through its configured control mechanism.
  8. Verify the endpoint, logs, assets, and service metrics.
  9. Retain the old release until the rollback and cache windows close.

This sequence separates preparation from activation. That separation, supervised foreground processes, worker-by-worker replacement, and backward-compatible schema evolution are the parts that turn a single VPS into a deployable Rails platform without a planned request outage.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.