7

我对水族馆和飞溅有一些问题。他们在开始后 30 分钟后停止工作。用于加载的页面数量为 50K-80K。我做了 cron 作业,每 10 分钟自动重启每个 Splash 容器,但它不起作用我该如何解决?

在此处输入图像描述 这是来自 HAProxy的屏幕截图和统计数据在此处输入图像描述 这是 Splash 配置

splash0:
    image: scrapinghub/splash:3.0
    command: --max-timeout 3600 --slots 150 --maxrss 1000 --verbosity 5
    logging:
      driver: "none"
    expose:
        - 8050
    mem_limit: 1000m
    memswap_limit: 1000m
    restart: always

和 HAProxy

    backend splash-cluster
    option httpchk GET /
    balance leastconn

    # try another instance when connection is dropped
    retries 2
    option redispatch
    server splash-0 splash0:8050 check maxconn 150 inter 2s fall 10 observe layer4
backend splash-misc
    balance roundrobin
    server splash-0 splash0:8050 check fall 15

更新 1 这是重新启动的脚本

    #!/bin/sh

echo "BEGIN" >> restart.log
for index in 0 1 2 3 4 5 6  7
do
    docker-compose restart splash$index
    echo "Restarted: Splash$index. Time: $(date '+%A %W %Y %X')" >> restart.log
    sleep 1
done
echo "END" >> restart.log

它应该可以工作,因为我在 Cronjob 文件中有日志:

cd /var/www/project/aquarium && sh splash_restart.sh
4

0 回答 0