PHPackages                             upscale/swoole-warmup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. upscale/swoole-warmup

ActiveLibrary

upscale/swoole-warmup
=====================

URL crawler to warm-up Swoole web-server

1.5.0(5y ago)120Apache-2.0PHPPHP &gt;=7.1

Since Mar 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/upscalesoftware/swoole-warmup)[ Packagist](https://packagist.org/packages/upscale/swoole-warmup)[ Docs](https://github.com/upscalesoftware/swoole-warmup)[ RSS](/packages/upscale-swoole-warmup/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (11)Used By (0)

Swoole Server Warm-Up
=====================

[](#swoole-server-warm-up)

This library pre-warms [Swoole](https://www.swoole.co.uk/) web-server by visiting given URLs on startup.

It takes time for a web-server to reach its cruising level of performance after the startup. Server warm-up is recommended to avoid first clients experiencing slowness while simultaneously overloading a cold server. This library makes it trivial to automate crawling of provided URLs to prime the server before use.

**Features:**

- Visit URLs on server startup
- Warm-up all workers at once
- Impersonate worker user/group
- Restart workers in warm state

Installation
------------

[](#installation)

The library is to be installed via [Composer](https://getcomposer.org/) as a dependency:

```
composer require upscale/swoole-warmup
```

Usage
-----

[](#usage)

Prime the server by visiting URLs on startup:

```
use Upscale\Swoole\Warmup;

require 'vendor/autoload.php';

$server = new \Swoole\Http\Server('127.0.0.1', 8080);
$server->set([
    'dispatch_mode' => 1,
    'user' => '_www',
]);

$state = 'cold';
$server->on('request', function ($request, $response) use ($server, &$state) {
    $response->header('Content-Type', 'text/plain');
    $response->end("Served by $state worker $server->worker_id\n");
    $state = 'warm';
});

$crawler = new Warmup\Crawler($server, new Warmup\RequestFactory($server));
$crawler->browse([
    'http://127.0.0.1:8080/',
]);
unset($crawler);

$server->start();
```

Technique
---------

[](#technique)

The warm-up mechanism is much more advanced than an ordinary HTTP crawler. First off, it dispatches requests before the server accepts any incoming connections. Secondly, the dispatch is carried out internally avoiding the overhead of external HTTP requests. Finally, the warm-up is performed in the main process used as an exemplar for forking worker processes. The warm-up extends to all workers altogether and the optimization effects persist beyond the lifetime of worker processes. Swoole workers are subject to periodic restart according to the [`max_request`](https://www.swoole.co.uk/docs/modules/swoole-server/configuration#max_request) setting as a memory leak mitigation measure.

Swoole allows to configure user and group ownership of worker processes via the settings [`user`](https://www.swoole.co.uk/docs/modules/swoole-server/configuration#user) and [`group`](https://www.swoole.co.uk/docs/modules/swoole-server/configuration#group) respectively. The warm-up is meant to run in the master process that can be owned by a different user, typically the `root` superuser. Process ownership mismatch can cause the access permission issues of the application accessing files in the filesystem. The worker process privileges are detected automatically and the user/group is imitated for the duration of the warm-up. The process privilege emulation relies on the process control extension [POSIX](https://www.php.net/manual/en/book.posix.php) being installed and enabled.

Contributing
------------

[](#contributing)

Pull Requests with fixes and improvements are welcome!

License
-------

[](#license)

Copyright © Upscale Software. All rights reserved.

Licensed under the [Apache License, Version 2.0](https://github.com/upscalesoftware/swoole-warmup/blob/master/LICENSE.txt).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~158 days

Total

10

Last Release

1978d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.1

1.2.0PHP &gt;=5.3

1.2.1PHP &gt;=5.4

1.3.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ff1791f1bd72221702e39e356c25b108de26dea1f5b56416f7957e8fa43ea92?d=identicon)[upscalesoftware](/maintainers/upscalesoftware)

---

Top Contributors

[![sshymko](https://avatars.githubusercontent.com/u/1231423?v=4)](https://github.com/sshymko "sshymko (25 commits)")

---

Tags

urlperformancecrawlerswooleprimewarmprewarmpre-warmwarm-upcold

### Embed Badge

![Health badge](/badges/upscale-swoole-warmup/health.svg)

```
[![Health](https://phpackages.com/badges/upscale-swoole-warmup/health.svg)](https://phpackages.com/packages/upscale-swoole-warmup)
```

###  Alternatives

[hhxsv5/laravel-s

🚀 LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.

3.9k676.0k10](/packages/hhxsv5-laravel-s)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5275.0k30](/packages/ionux-phactor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
