# Managing Load with the Traefik Queue Manager Plugin + Pangolin

**URL:** <https://forum.hhf.technology/t/managing-load-with-the-traefik-queue-manager-plugin-pangolin/2246>\
**Category:** Guides & Tutorials\
**Tags:** middleware-manager, traefik, pangolin\
**Created:** [May 27, 2025, 8:29am UTC](https://forum.hhf.technology/t/managing-load-with-the-traefik-queue-manager-plugin-pangolin/2246 "2025-05-27T08:29:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattercoder](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/m/54ee81/32.png) [@Mattercoder](https://forum.hhf.technology/u/Mattercoder)\
**Post date:** [May 27, 2025, 8:29am UTC](https://forum.hhf.technology/t/managing-load-with-the-traefik-queue-manager-plugin-pangolin/2246/1 "2025-05-27T08:29:13Z")

</div>

# 🚪 Managing Load with the Traefik Queue Manager Plugin + Pangolin

[Traefik Queue Manager](https://github.com/hhftechnology/traefik-queue-manager) is a middleware plugin designed to control traffic spikes by queuing users when service capacity is exceeded. Combined with **Pangolin** and **Middleware Manager** , it’s a powerful solution for managing traffic overload.

This guide walks you through a **minimal working implementation**.

> 💡 Prerequisite: Set up the [Traefik Dashboard](https://forum.hhf.technology/t/traefik-dashboard-a-vital-prerequisite-for-debugging-pangolin-and-middleware-manager/2208) to debug config issues.

* * *

## 📒 Features

- Custom queue page
- Configurable max users (maxEntries)
- First-come, first-served access
- Visual position and wait time tracking
- Cookie-based or IP/UserAgent session tracking

* * *

## 🚀 Step-by-Step Setup

### Step 1: Add the Plugin via Plugin Hub

Enable the plugin by adding to `traefik_config.yml`:

```yaml
experimental:
  plugins:
    traefik-queue-manager:
      moduleName: "github.com/hhftechnology/traefik-queue-manager"
      version: "v1.0.2"

```

Restart Traefik:

```bash
docker compose restart traefik

```

 ![professional-queue](https://forum-cdn.hhf.technology/original/2X/2/277a2cd3c65b176060c25f6d699be5bfc277cba6.png)

> 📷 **Screenshot: Traefik config with plugin block enabled:**

* * *

### Step 2: Prepare Your Queue Page

Create a directory for static assets:

```bash
mkdir -p ./public_html

```

Create `public_html/queue-page.html` with this content:

```html
<!DOCTYPE html>
<html>
<body>
<h1>Your in a queue</h1>
<p>[[.Position]] - Current position in queue</p>
<p>[[.QueueSize]] - Total queue size</p>
<p>[[.EstimatedWaitTime]] - Estimated wait time in minutes</p>
<p>[[.RefreshInterval]] - Refresh interval in seconds</p>
<p>[[.ProgressPercentage]] - Visual progress percentage</p>
<p>[[.Message]] - Custom message</p>
</body>
</html>

```

Update your `docker-compose.yml` Traefik service:

```yaml
volumes:
  - ./public_html:/var/www/html:ro

```

Restart Traefik:

```bash
docker compose restart traefik

```

Verify with:

```bash
docker exec -it traefik sh
ls /var/www/html

```

* * *

### Step 3: Add Middleware Template

Append to `middleware-manager/templates.yml`:

```yaml
- id: "traefik-queue-manager"
  name: "Traefik Queue Manager"
  type: "plugin"
  config:
    traefik-queue-manager:
      cookieName: queue-manager-id-random-number-here
      enabled: true
      maxEntries: 500
      queuePageFile: /var/www/html/queue-page.html
      sessionTime: 5m
      useCookies: "true"

```

 ![adding-plugin-using-middleware](https://forum-cdn.hhf.technology/original/2X/b/b7cc12792363f916a9e3beffb882ef13652df92d.png)

> 📷 **Screenshot Queue Manager middleware visible in UI**

Restart Middleware Manager:

```bash
docker compose restart middleware-manager

```

* * *

### Step 4: Create a Protected Resource

If you don’t have one, create a temporary resource:

Add to `docker-compose.yml`:

```yaml
python-http:
  image: python:3.11-slim
  container_name: python-http
  working_dir: /app
  command: python -m http.server 15000
  ports:
    - "15000:15000"
  restart: unless-stopped

```

In Pangolin:

- Create resource `mywebsite.yourdomain.com`
- Target service: `python-http` on port 15000
- Attach the `Traefik Queue Manager` middleware in Middleware Manager

 ![pangolin-resource](https://forum-cdn.hhf.technology/original/2X/1/11a89a3314925943edeb138b672a3cfb7b73af32.png)

> 📷 **Screenshot Resource setup screen in Pangolin**

 ![add-middleware-to-resource](https://forum-cdn.hhf.technology/original/2X/0/02254bdbac4b4bed589eddf498c7eccc391a2a39.png)

> 📷 **Screenshot add middleware in Middleware Manager**

* * *

### Step 5: Test It Out

Visit:

```auto
https://mywebsite.yourdomain.com

```

You should be allowed through because usage is below the threshold.

Now edit the middleware to simulate a queue:

```json
"maxEntries": 1

```

Visit again in a second tab or incognito. You should see the queue page.

 ![queue-message](https://forum-cdn.hhf.technology/original/2X/8/892874eef27d8e83a85f07786a008c85ffcf0fbc.png)

> 📷 **Screenshot Queue HTML page rendered with position and wait time**

* * *

## ✨ Wrap-Up

You now have a working example of the Traefik Queue Manager in action with:

- HTML queue pages
- Session management
- Load control

> 📅 Want more? View advanced config options here: [Plugin Page](https://plugins.traefik.io/plugins/682cb52d5cf75d3c3d216b25/queue-manager)

* * *

## 🙏 Thanks for Following Along!

You just implemented fair, graceful queuing with Traefik, Pangolin, and Middleware Manager. Perfect for launch days, flash sales, and peak usage moments.

Happy queueing! 🌐
