diff --git a/assisted_startup.sh b/assisted_startup.sh index 2fcbb84150c56eace54687b0682786a9526dccc8..32d1617f6a1b4d23cb3579dbc1bafcf685b43c0b 100755 --- a/assisted_startup.sh +++ b/assisted_startup.sh @@ -274,7 +274,7 @@ else swap_location=$(swapon --show=NAME --noheadings) - if [[ $physical_memory -gt 60 && $free_memory -gt 30 && $NO_RAMDISK != 1 ]]; then + if [[ $physical_memory -ge 60 && $free_memory -gt 30 && $NO_RAMDISK != 1 ]]; then echo "There is more than 64 gigabytes of RAM. Mounting shared_mem..." if [ ! -d "/mnt/haf_shared_mem" ]; then sudo mkdir /mnt/haf_shared_mem @@ -403,7 +403,7 @@ while read -r line; do echo "Detected *PROFILE: Entered LIVE sync* in the output. Bringing down Docker Compose..." entered_livesync=1 # Write Sync time to "haf.log" for tracking, as this log will get wiped on restart - docker logs haf-world-haf-1 | grep PRO > haf.log + docker compose logs haf | grep PROFILE > haf.log # Write max memory and swap usage to "haf.log" for tracking grep "max_mem=" startup.temp >> haf.log grep "max_swap=" startup.temp >> haf.log diff --git a/haproxy/haproxy.cfg b/haproxy/haproxy.cfg index 47310e5a37c8611bace1f5a8d783210ddb22fcef..5b5aa3728dd1380ea73497667135eca87064b20b 100644 --- a/haproxy/haproxy.cfg +++ b/haproxy/haproxy.cfg @@ -6,6 +6,14 @@ global presetenv SYNC_BROADCAST_BACKEND_SERVER api.hive.blog presetenv SYNC_BROADCAST_BACKEND_PORT 443 presetenv SYNC_BROADCAST_BACKEND_SSL ssl + # maxconn needs to be set to handle our maximum expected load. + # Let's say we want to handle 10000 calls/second. + # Most of our API calls will timeout after 3 seconds. If we assume + # the worst case, where all of the calls take the full 3 seconds, we + # should expect 30000 calls in flight at any one time. We'll round up + # to 32768. In reality, the vast majority of calls should be handled + # in a few tens of milliseconds so this should be massive overkill. + maxconn 32768 # DEFAULTS # do not put a defaults section here, the defaults section is included