分类: Linux

504/522 Incident Review: When the App Was Fast but Users Still Timed Out

Date: 2026-06-14
Primary symptom: pages opened slowly and some requests returned 504 or 522-like timeout errors
Primary cause: relay-to-origin TCP connection pressure, not slow application response

Background

The production path was not a single-hop request from users to the application server. Traffic passed through a relay layer before reaching the origin server:

users -> edge or relay layer -> origin web server -> application server

That detail mattered. A slow browser experience can come from several different layers:

  • The browser or outer proxy waiting on the relay.
  • The relay waiting on the origin.
  • The origin web server waiting on the application server.
  • The application or database generating a slow response.

The first checks showed that the application was responding quickly when tested locally from the origin. That changed the investigation from "why is the app slow?" to "where is the request waiting before it reaches the app?"

继续阅读

Debian 使用 Docker Compose 部署 hacdias/webdav

Debian 使用 Docker Compose 部署 hacdias/webdav

项目地址:https://github.com/hacdias/webdav
镜像ghcr.io/hacdias/webdav:latest(推荐)或 hacdias/webdav:latest
部署目录/var/www/webdav/(所有文件集中管理)

1. 目录结构(推荐)

/var/www/webdav/
├── docker-compose.yml     # Docker Compose 主配置文件
├── config.yml             # WebDAV 核心配置文件(用户名、密码、权限等)
├── README.md              # 本文档(可直接复制官方 README)
└── data/                  # WebDAV 实际存储目录(挂载到容器 /data)

2. 前置条件

# 1. 更新系统并安装 Docker + Compose
sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io docker-compose-plugin

# 2. 将当前用户加入 docker 组(无需每次 sudo)
sudo usermod -aG docker $USER
newgrp docker   # 或重启终端

3. 一键创建部署目录和文件

# 创建目录
sudo mkdir -p /var/www/webdav/data
sudo chown -R $USER:$USER /var/www/webdav

# 进入目录
cd /var/www/webdav

继续阅读

Installing the Latest avifenc on Debian 12 (Bookworm)

Prerequisites

  • Ensure you have root or sudo access.
  • A working internet connection to download source code and dependencies.
  • Optional: Exit any Python virtual environment to avoid tool conflicts (deactivate if in a (venv)).

Steps

  1. Install Build Dependencies
    Install the necessary tools and libraries for compiling libavif and its dependencies.

    sudo apt update
    sudo apt install -y build-essential cmake ninja-build libpng-dev libjpeg-dev yasm pandoc git libaom-dev
    
  2. Clone the libavif Repository
    Download the latest libavif source code from GitHub.

    git clone https://github.com/AOMediaCodec/libavif.git
    cd libavif
    

继续阅读

使用 Docker Compose 搭建 Fiora 聊天室

引用

https://github.com/yinxin630/fiora
https://github.com/yinxin630/fiora/blob/master/docker-compose.yaml
https://yinxin630.github.io/fiora/zh-Hans/docs/install#docker-%E8%BF%90%E8%A1%8C

docker-compose.yml 文件

services:
  mongodb:
    image: mongo
    container_name: fiora_db
    volumes:
      - ${PWD}/data/mongo:/data/db
    restart: always

  redis:
    image: redis
    container_name: fiora_redis
    volumes:
      - ${PWD}/data/redis:/data
    restart: always

  fiora:
    image: suisuijiang/fiora
    container_name: fiora
    ports:
      - "127.0.0.1:9200:9200"
    environment:
      - Database=mongodb://mongodb:27017/fiora
      - RedisHost=redis
      - Administrator=admin
      - DisableCreateGroup=true
    depends_on:
      - mongodb
      - redis
    restart: always

继续阅读

使用 Docker Compose 搭建 Lsky Pro 图床服务

简介

Lsky Pro 是一款开源的图床程序,支持多种存储方式,提供了良好的用户界面和丰富的功能。本文将详细介绍如何使用 Docker Compose 来部署 Lsky Pro,这种方式相比传统安装更加简单和可维护。

引用

https://docs.lsky.pro/guide/install
https://www.cpolar.com/blog/casaos-uses-docker-to-build-lsky-pro-locally
https://hub.docker.com/r/dko0/lsky-pro
https://blog.laoda.de/archives/docker-compose-install-lskypro
https://github.com/lsky-org/lsky-pro/issues/256

环境要求

  • Docker 20.10.0 或更高版本
  • Docker Compose V2
  • 2GB 或更多内存
  • 域名(用于网络访问)
  • Nginx(用于反向代理)

部署步骤

1. 创建项目目录

mkdir lsky-pro
cd lsky-pro

继续阅读

使用Docker独立部署Waline评论系统的完整指南

引言

Waline是一个简洁、安全的评论系统,支持多种部署方式。本文将介绍如何使用Docker独立部署Waline,并配置MySQL数据库来存储评论数据。通过Docker部署不仅简化了安装过程,还提供了更好的环境隔离和可移植性。

参考资料

https://waline.js.org/guide/database.html
https://bg3lnt.xyz/posts/dc23e930.html

先决条件

在开始部署之前,请确保您的系统满足以下要求:

  • 已安装Docker和Docker Compose
  • 了解基本的命令行操作
  • 准备好域名和服务器(如需公网访问)

继续阅读

在Debian 12上配置Nginx、Cloudflare CDN和SSL证书

在本文中,我们将详细介绍如何在Debian 12服务器上配置Nginx,设置Cloudflare CDN,以及为需要直接访问源站的特殊程序申请SSL证书。这个过程涉及多个步骤,包括安装Nginx,配置域名,使用Cloudflare CDN,以及使用Certbot申请SSL证书。

0. 引用

https://certbot-dns-cloudflare.readthedocs.io/en/stable/
https://lucasc.me/post/howto-certbot-dns-cloudflare-in-webmin

1. 安装和配置Nginx

首先,我们在Debian 12服务器上安装Nginx:

sudo apt update
sudo apt install nginx

安装完成后,配置您的域名。编辑Nginx配置文件,通常位于/etc/nginx/sites-available/目录下。

2. 配置Cloudflare CDN

接下来,我们使用Cloudflare CDN来提高网站性能和安全性:

  • 在Cloudflare上注册账户并添加您的域名。
  • 更新域名的DNS记录,将其指向Cloudflare的名称服务器。
  • 在Cloudflare仪表板中,确保SSL/TLS设置为"Flexible"模式。

继续阅读

使用Cloudflare API自动切换DNS

在这篇文章中,我们将探讨如何使用Cloudflare API自动切换DNS。我们将使用Uptime Kuma来监控网站运行状态,并通过webhook进行通知。我们还将运行webhookd服务来接收Uptime Kuma的请求,并在网站状态出现问题时,使用Cloudflare API切换到备用服务器。

引用

https://github.com/louislam/uptime-kuma
https://github.com/ncarlier/webhookd
https://github.com/ncarlier/webhookd/issues/82
https://www.tech-otaku.com/web-development/using-cloudflare-api-manage-dns-records/

监控网站运行状态

首先,我们需要一个工具来监控我们的网站运行状态。这里,我们选择使用Uptime Kuma,它是一个功能强大的开源监控工具,可以帮助我们实时了解网站的运行状况。
当Uptime Kuma检测到网站状态发生变化时,它可以通过webhook发送通知。我们需要运行一个webhookd服务来接收这些通知。

继续阅读

Debian Rclone automount | Rclone 自动挂载

Debian Rclone automount | Rclone 自动挂载

引用

https://github.com/rclone/rclone/wiki/Systemd-rclone-mount#systemd

前提

  • 安装rclone
  • 配置远程服务器,eg:my_remote_service, (default config location: ~/.config/rclone/rclone.conf)

操作

[Unit]
Description=RClone mount of users remote %i using filesystem permissions
Documentation=http://rclone.org/docs/
After=network-online.target

....

继续阅读

Flarum nginx 配置

官方安装文档

https://docs.flarum.org/install

参考官方安装文档就行,先把基本都安装好,

其中有一个URL Rewriting ,我使用的Nginx,

所以需要创建一个,nginx.site.config

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name domain.com;

    root /path/to/flarum/public;
    index index.html index.htm index.php;
    include /path/to/.nginx.conf;

    # URI 符合正则表达式 [\.php$] 的请求将进入此段配置
    location ~ \.php$ {
        # 配置 FastCGI 服务地址,可以为 IP:端口,也可以为 Unix socket。
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        # 配置 FastCGI 的主页为 index.php。
        fastcgi_index index.php;
        # 配置 FastCGI 参数 SCRIPT_FILENAME 为 $realpath_root$fastcgi_script_name。
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        # 引用更多默认的 FastCGI 参数。
        include fastcgi_params;
    }

    #ssl_certificate xxx
    #ssl_certificate_key yyy

}

继续阅读

Viagle Blog

欢迎来到我的个人博客网站