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

Run Laravel as a set of interchangeable, stateless application nodes, put them behind a load balancer, centralize sessions/cache/queues in Redis, store uploads outside local disks, and place a connection pooler such as PgBouncer in front of PostgreSQL. Add streaming read replicas only after connection management and application-node scaling are working, then route reads deliberately and keep consistency-sensitive reads on the primary.

What horizontal scaling means for Laravel on VPS servers

Horizontal scaling adds more servers instead of making one VPS larger. A request can land on any application node, a queue job can be processed by any worker, and PostgreSQL remains the system of record. This design increases capacity and gives you a way to remove or replace a node without taking the application offline.

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

The key requirement is that an application node must not own irreplaceable state. If sessions, cache entries, queued jobs, or uploaded files exist only on one VPS, a load balancer will eventually send a request to a node that cannot see them. The scalable layout therefore separates concerns:

  • Application nodes: identical Laravel releases serving HTTP traffic.
  • Shared Redis: sessions, cache, and the queue backend.
  • Object storage: user uploads and other durable files.
  • Queue workers: separate processes or worker VPSs using the same Redis backend.
  • PostgreSQL primary: all writes and any read that must be current.
  • Optional PostgreSQL replicas: read capacity, not a cure for an individual slow query.
  • Connection pooler: PgBouncer between Laravel processes and PostgreSQL.
  • Load balancer: distributes HTTP traffic and removes unhealthy nodes.

Scale in this order: externalize shared state, move files, add pooling, add stateless application and worker nodes, and only then introduce replicas when read demand justifies their operational cost.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Target architecture and traffic flow

A typical VPS deployment has a public load balancer in front of two or more application VPSs. Each node runs the same code, environment values, PHP runtime, and compiled configuration. The load balancer performs health checks and forwards requests to healthy nodes.

Every application node connects to one shared Redis service for sessions, cache, and queues. Queue workers can run on dedicated VPSs; they use the same Redis connection and therefore see the same jobs regardless of which worker accepts one.

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

Laravel connects to PgBouncer rather than opening an independent PostgreSQL connection directly from every PHP worker. PgBouncer reuses a bounded set of database connections, reducing connection churn during traffic spikes. The pooler then sends traffic to the PostgreSQL primary, or to a deliberate read-routing layer when replicas are enabled.

With streaming replication, PostgreSQL replicas receive WAL changes from the primary. A proxy such as HAProxy or Pgpool-II can direct writes to the primary and eligible reads to replicas. Because replication is normally asynchronous, a replica can lag; the architecture must treat freshness as a routing decision rather than an assumption.

Prepare every VPS before adding traffic

Use identical application releases

Build one release artifact and deploy that same commit to every application node. Keep environment-specific values outside the artifact, but keep application code, PHP extensions, Composer dependencies, and front-end assets consistent. Run migrations as a controlled deployment step, not independently on each node.

Laravel’s cached configuration must be rebuilt whenever environment values change. A node with stale database or Redis settings can appear healthy while sending requests to the wrong service. Include a release identifier in a health endpoint or response header so the load balancer and operators can identify mixed versions during a rollout.

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

Make local disks disposable

Do not rely on storage/app or another node-local directory for files that users must retrieve later. A request that uploads to node A and downloads from node B will fail unless the file is copied between nodes. Configure Laravel’s filesystem to use shared object storage, and keep only temporary processing files locally. Back up the object store independently of the VPSs.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Define health checks that test dependencies

A load balancer should stop sending traffic to a node that cannot serve requests. A useful health endpoint checks the application process and, where appropriate, verifies Redis and the database through short-timeout checks. Keep the endpoint inexpensive; do not run a full business query on every probe. Distinguish readiness (safe to receive traffic) from liveness (the process is running) when your deployment tooling supports both.

Step 1: centralize sessions, cache, and queues in Redis

All application nodes must use the same Redis backend. Configure the same Redis host, port, authentication, database selection, and TLS settings on every node. In Laravel, set the session driver to Redis, the cache store to Redis, and the queue connection to Redis. The exact environment variable names depend on your Laravel version and existing configuration, so verify that config/session.php, config/cache.php, and config/queue.php resolve to the shared service after configuration caching.

A representative environment configuration looks like this (adapt names to your deployment):

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.
SESSION_DRIVER=redis
CACHE_STORE=redis
QUEUE_CONNECTION=redis
REDIS_HOST=redis.internal
REDIS_PORT=6379
REDIS_PASSWORD=your-secret

Use a Redis deployment with persistence, authentication, network restrictions, monitoring, and a recovery plan. Redis is now a shared dependency: if it is unavailable, users may lose sessions, cache misses may increase sharply, and queued work can stop. Do not expose Redis directly to the public internet.

Session behavior during a rollout

After moving sessions to Redis, a user can authenticate on one application node and continue on another. Existing sessions stored in a node-local driver will not automatically appear in Redis, so plan a transition that may require users to sign in again. Keep the session cookie name, encryption key, and domain settings identical across nodes; changing the application key invalidates encrypted sessions.

Queue names and idempotency

Use explicit queue names for workloads with different urgency or resource needs. Jobs must be idempotent: a timeout, worker crash, or retry can execute a job again. Protect external side effects with unique keys or database constraints. Redis prevents two workers from claiming the same queued item at the same time, but it cannot make a non-idempotent job safe after a process failure.

Step 2: move uploads to shared object storage

Configure Laravel’s filesystem disk for object storage and point upload, download, and deletion code at that disk. Generate temporary or signed URLs where appropriate instead of proxying every large file through PHP. Keep private files private by default and enforce authorization before issuing a URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Before switching production traffic, test the complete lifecycle from each application node: upload, metadata persistence, authorized download, unauthorized download, replacement, deletion, and retry after a transient storage error. Confirm that queued image or video processing workers can read the same object-store path that the web request created.

Step 3: add PgBouncer before PostgreSQL replicas

PHP-FPM and queue workers can create many short-lived database connections. PostgreSQL allocates significant resources per connection, so a traffic increase can exhaust connection limits even when query volume is moderate. Place PgBouncer in front of PostgreSQL and point Laravel’s database host and port at the pooler.

Choose a pooling mode compatible with your application. Transaction pooling gives high reuse, but session-level PostgreSQL features that must persist across transactions may require session pooling or code changes. Validate prepared statements, advisory locks, temporary tables, and transaction behavior in a staging environment before changing modes.

Set pool limits from measured PostgreSQL capacity, not from the number of application processes. Reserve headroom for administrative access, migrations, and monitoring. A pooler limits connection pressure; it does not reduce the work performed by expensive SQL, so continue indexing and query-tuning separately.

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

Safe rollout sequence for the pooler

  1. Install PgBouncer on a protected VPS or close to the database network.
  2. Configure authentication and TLS according to your security policy.
  3. Create a database alias that points to the current PostgreSQL primary.
  4. Test Laravel HTTP requests, transactions, queue jobs, migrations, and long-running commands through the pooler.
  5. Change the Laravel database host and port on one canary node.
  6. Watch connection counts, transaction latency, errors, and lock behavior before moving the remaining nodes.

Step 4: run stateless application nodes behind a load balancer

Add a second application VPS only after it can pass the same health checks and reach Redis, object storage, and PgBouncer. Configure the load balancer with a health-check path, connection and response timeouts, and a draining procedure so a node can finish in-flight requests before maintenance.

Because sessions are in Redis, requests do not require sticky load-balancer sessions. Avoid enabling stickiness as a substitute for shared state: it hides broken architecture and makes failures more disruptive. If a framework feature temporarily requires affinity, document the reason and its failure behavior.

Deployment order for multiple nodes

  1. Remove one node from rotation or mark it draining.
  2. Deploy the new release and rebuild Laravel’s cached configuration.
  3. Run smoke tests for authentication, database writes, Redis-backed sessions, queues, and object storage.
  4. Return the node to rotation and observe errors and latency.
  5. Repeat for the remaining nodes.

Database schema changes must be backward-compatible with both the old and new application versions during a rolling deployment. Add nullable columns or new tables first, deploy code that can handle both schemas, backfill safely, and remove old structures only after all nodes have moved to the new release.

Step 5: scale queues with Horizon on shared Redis

Run Horizon on every worker server against the same Redis backend. Redis coordinates job reservation, so multiple Horizon instances can process one queue without intentionally double-claiming a job. Keep workers separate from web nodes when queue bursts, CPU-heavy jobs, or memory growth could affect request latency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Horizon adjusts worker counts for a supervisor between configured minimum and maximum values according to queue wait times. This is different from launching a fixed number of queue:work processes and hoping they match demand.

php artisan horizon

Run Horizon under a process supervisor that restarts it after failure and starts it automatically after reboot. Set job timeouts, retry limits, backoff, and memory limits deliberately. A worker that is killed after exceeding its timeout can leave an external operation half-complete, so idempotency and transactional boundaries still matter.

Design supervisors by workload

  • Interactive jobs: short tasks that should clear quickly and keep user-facing latency predictable.
  • Heavy jobs: image, export, or data-processing work with separate concurrency and memory limits.
  • Critical jobs: payment, notification, or integration work with explicit retry and alerting policies.

Monitor queue wait time, throughput, failed jobs, worker memory, and Redis latency. Increasing worker counts without checking database capacity can simply move the bottleneck to PostgreSQL.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Step 6: add PostgreSQL read replicas only when reads require them

Streaming replicas copy changes from the primary and can serve read traffic. They are useful when read workload is large enough that scaling application nodes and pooling no longer provides sufficient headroom. A replica does not make one slow query faster; indexing, query plans, schema design, or caching are the remedies for that problem.

Replicas add operational work: replication monitoring, lag handling, backups, upgrades, and failover decisions. Add them when measured read pressure justifies this complexity, not because a particular storage-size threshold is advertised. No authoritative 500 GB rule establishes when replicas are required.

Separate read and write connections in Laravel

Laravel supports separate read and write host arrays in config/database.php. The write array points to the primary; the read array can contain replica hosts or a read-routing proxy. An illustrative configuration is:

'pgsql' => [
    'driver' => 'pgsql',
    'read' => [
        'host' => [env('DB_READ_HOST_1'), env('DB_READ_HOST_2')],
    ],
    'write' => [
        'host' => [env('DB_WRITE_HOST')],
    ],
    'sticky' => true,
    'port' => env('DB_PORT', 5432),
    'database' => env('DB_DATABASE'),
    'username' => env('DB_USERNAME'),
    'password' => env('DB_PASSWORD'),
],

The sticky option is important for read-after-write behavior. When enabled, reads made after a write during the same request use the write connection, so a newly created record can be read immediately from the primary instead of landing on a lagging replica. This does not guarantee consistency across later requests, jobs, or separate processes.

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

Choose the primary for freshness-sensitive reads

Send reads to the primary when the user expects an immediately current result: confirmation pages after a write, authorization checks, inventory or balance decisions, and workflows that depend on the latest state. Use replicas for intentionally stale-tolerant workloads such as reports, search pages, and large read-only views, with an acceptable lag budget.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Route replicas through a health-aware proxy

A proxy such as HAProxy or Pgpool-II can direct writes to the primary and reads to healthy replicas. The proxy must remove a lagging or disconnected replica from the read pool and expose clear health state to operators. Test what happens when the primary fails, when a replica falls behind, and when a proxy has no eligible backend.

Replication lag, failover, and recovery

Measure lag instead of guessing

Track replay delay, WAL shipping status, replica connection state, read latency, and error rates. Define an operational threshold at which a replica is removed from read traffic. Alert before users experience stale data, not only after replication stops.

Plan promotion and endpoint changes

A failover process must promote a suitable replica, redirect the write endpoint, and prevent the old primary from accepting conflicting writes. Patroni is commonly suggested for PostgreSQL failover orchestration, but its suitability and configuration require validation for your environment; do not treat it as an automatic guarantee. Document who approves promotion, how applications discover the new primary, and how the old node is rejoined safely.

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

Test failure scenarios

  • Stop one application node and verify the load balancer drains it.
  • Temporarily block a worker node and confirm other Horizon instances continue processing.
  • Make Redis unavailable and verify alerts, timeout behavior, and recovery.
  • Detach a replica and confirm it is removed from read routing.
  • Simulate primary failure in a maintenance window and rehearse promotion and Laravel endpoint updates.

Observability and capacity decisions

Horizontal scaling is effective only when you can identify the constrained resource. Collect metrics by node and by dependency:

  • Load balancer: healthy backends, active connections, request rate, status codes, and response-time percentiles.
  • PHP/Laravel: worker utilization, memory, exceptions, slow requests, and route-level latency.
  • Redis: memory, evictions, blocked clients, command latency, connection count, and queue depth.
  • PostgreSQL: active connections, transaction latency, locks, slow queries, cache hit behavior, CPU, memory, storage I/O, and replication lag.
  • Horizon: queue wait time, throughput, failed jobs, retries, and worker restarts.
  • Object storage: request failures, latency, capacity, and authorization errors.

Scale the component whose saturation is limiting user-visible performance. More web nodes will not fix a saturated database; more workers will not fix a slow query; and a read replica will not fix a write bottleneck.

Common failure modes and fixes

Users are logged out when requests switch nodes

The session driver or encryption settings differ between nodes. Point every node at the same Redis session store and use identical application-key and cookie settings. Expect existing node-local sessions to require reauthentication during migration.

Uploaded files disappear intermittently

Files are being written to local disk. Move the Laravel filesystem disk to shared object storage and test reads from every node.

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

PostgreSQL reports too many connections

Application processes are connecting directly or pool limits are too high. Put PgBouncer in front, cap pools based on database capacity, and reserve connections for administration and migrations.

Users do not see a record immediately after saving

The follow-up read reached a lagging replica. Enable Laravel’s sticky read/write behavior for the request, or route that workflow explicitly to the primary.

Adding replicas does not reduce latency

The workload may be write-bound, connection-bound, or dominated by one inefficient query. Inspect query plans, indexes, locks, and primary utilization before adding more replicas.

Queue jobs run twice

A timeout, retry, or worker crash can cause a job to execute again even with shared Redis. Make the job idempotent, use unique constraints or idempotency keys, and set timeouts longer than the expected operation.

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

A practical rollout checklist

  1. Inventory every stateful Laravel feature, including sessions, cache, queues, scheduled tasks, temporary files, and uploads.
  2. Provision protected shared Redis and migrate sessions, cache, and queues.
  3. Move durable files to object storage and validate permissions and lifecycle behavior.
  4. Deploy a second identical application node and place both behind health-checked load balancing.
  5. Run queue workers on dedicated nodes or isolated worker pools with Horizon and shared Redis.
  6. Install and test PgBouncer; migrate one canary node, then the rest.
  7. Measure primary read load, connection pressure, query latency, and replication need.
  8. If justified, deploy streaming replicas and a health-aware read/write routing layer.
  9. Configure Laravel read/write hosts and enable sticky behavior for read-after-write requests.
  10. Document lag thresholds, failover ownership, backups, restore tests, and rollback steps.
  11. Exercise node, Redis, worker, replica, and primary failures before declaring the design production-ready.

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.