Memo

共 49 条灌水 · 4

提高 Meilisearch 请求体大小限制

MEILI_HTTP_PAYLOAD_SIZE_LIMIT=1Gb

可写入 Meilisearch 的服务配置或环境变量。

Kopia 配置文件位置

  • Windows: %APPDATA%\kopia\repository.config
  • macOS: $HOME/Library/Application Support/kopia/repository.config
  • Linux: $HOME/.config/kopia/repository.config

迁移 Kopia 快照

kopia snapshot migrate --source-config ./repository.config --all

理解 Nginx 499 与客户端超时

若 Nginx 的 upstream 超时为 60 秒,而客户端请求超时为 15 秒,处理超过 15 秒的请求会先被客户端断开。Nginx 尚未达到 504 的判定阈值,因此记录为 499。

排查时应同时核对客户端、代理和 upstream 的超时配置。

使用 Docker Compose 运行 node-exporter

services:
  node_exporter:
    image: quay.io/prometheus/node-exporter:latest
    container_name: node-exporter
    command:
      - '--path.rootfs=/host'
    network_mode: host
    pid: host
    restart: unless-stopped
    volumes:
      - '/:/host:ro,rslave'

按内容查询 Git 提交

git log -S '<your-query-keyword>' --format='%h %s' --source --all

顺序一致性与线性一致性

Zab 保证顺序一致性,Raft 通常提供线性一致性语义。顺序一致性不带真实时间约束,因此读操作在语义上可能返回旧值;线性一致性则要求结果符合现实中的先后顺序。

对于分布式协调服务,单客户端 FIFO 不等于所有客户端都能得到线性一致读。

使用 nftables 模拟丢包

丢弃目标端口的入站 TCP 流量:

sudo nft create table ip filter
sudo nft add chain ip filter input { type filter hook input priority 0 \; }
sudo nft add rule ip filter input tcp dport 3888 counter drop

恢复前先查看 handle,再删除对应规则:

sudo nft list chain ip filter input
sudo nft delete rule ip filter input handle n