想玩遊戲時被自動更新打斷,看了一下還有什麼功能可以更新,發現還不少:
- 可以買處住,好像還可以自己裝潢的樣子
- 地圖檢視工具更新,可以過濾掉不需要的資訊標示
- 新增武器、零件和有的沒的
- 更新 AI 系統
- 調整交通工具駕駛時的操作界面
官方給的更新資訊細節太多,懶得看完,有興趣的自己去追:https://store.steampowered.com/news/app/1091500/view/5121158897695279077
軟體開發、伺服器和生活瑣事
想玩遊戲時被自動更新打斷,看了一下還有什麼功能可以更新,發現還不少:
官方給的更新資訊細節太多,懶得看完,有興趣的自己去追:https://store.steampowered.com/news/app/1091500/view/5121158897695279077
塞個資料,沒想到 Redis 一直炸,看 log 才發現有設定要調整:
356416:C 15 Feb 2022 14:53:43.009 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 356416:C 15 Feb 2022 14:53:43.009 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=356416, just started 356416:C 15 Feb 2022 14:53:43.009 # Configuration loaded 356416:M 15 Feb 2022 14:53:43.010 * monotonic clock: POSIX clock_gettime 356416:M 15 Feb 2022 14:53:43.012 * Running mode=standalone, port=6379. 356416:M 15 Feb 2022 14:53:43.012 # Server initialized 356416:M 15 Feb 2022 14:53:43.012 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 356416:M 15 Feb 2022 14:53:43.017 * Loading RDB produced by version 6.2.6 356416:M 15 Feb 2022 14:53:43.017 * RDB age 1475 seconds 356416:M 15 Feb 2022 14:53:43.017 * RDB memory usage when created 5243.48 Mb 356416:signal-handler (1644908113) Received shutdown signal during loading, exiting now. 356427:C 15 Feb 2022 14:55:14.014 * Supervised by systemd. Please make sure you set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
注意到錯誤訊息中間有個關鍵字 vm.overcommit_memory,如果遇到 sysctl 或 vm 相關的,大多是與 Linux 系統參數有關係,這邊有 overcommit_memory 的設定說明,該設定會保護系統不會接受大型記憶體 allocate 的請求。
但 Redis 本來就是使用記憶體做服務,因此需要去 /etc/sysctl.conf 新增下面這段設定:
vm.overcommit_memory = 1
重新開機後即可套用設定。
另外 Redis 會在機器啟動時,從硬碟將 persistent data 載入記憶體中,若資料不少,載入會花掉相當的時間,因此 systemd 預設的設定,可能會誤以為 Redis 啟動失敗:
redis-server.service: start operation timed out. Terminating.
依據資料多寡,會影響 Redis 啟動的時間,所以需要調整 systemd 的 timeout。
開啟 /etc/systemd/system/redis.service 注意下面幾個 timeout 相關的參數:
TimeoutStartSec=300 TimeoutStopSec=300
參考 systemd 的文件,TimeoutStartSec=300
也可以改成可讀格式 TimeoutStartSec="5min"
。
2022-02-18 更新:
感謝 JoeHorn 提醒,直接修改 /etc/systemd/
底下的設定檔是有風險的,建議透過 systemctl edit xxx.service
的方式 override 預設參數值。
最近常需要決定專案到底要使用工具、平台來開發,結果常常會因為社群差異栽一腳。
像是:
查資料注意到 Apache Bench 並沒有 follow redirect 的功能,因此部分的測試可能會不準確。
文章中看到作者推薦了一個新的工具 – Siege,一個功能比 Apache Bench 更完整的 HTTP server 壓力測試工具,可以支援的功能也更齊全:
$ siege -C CURRENT SIEGE CONFIGURATION Mozilla/5.0 (pc-x86_64-linux-gnu) Siege/4.0.4 Edit the resource file to change the settings. ---------------------------------------------- version: 4.0.4 verbose: false color: true quiet: false debug: false protocol: HTTP/1.1 HTML parser: disabled get method: HEAD connection: close concurrent users: 25 time to run: n/a repetitions: n/a socket timeout: 30 cache enabled: false .....
執行測試的範例:
$ siege -c 1 -r 100 'https://www.your.domain/' ** SIEGE 4.0.4 ** Preparing 1 concurrent users for battle. The server is now under siege... Transactions: 200 hits Availability: 100.00 % Elapsed time: 43.85 secs Data transferred: 0.53 MB Response time: 0.22 secs Transaction rate: 4.56 trans/sec Throughput: 0.01 MB/sec Concurrency: 1.00 Successful transactions: 200 Failed transactions: 0 Longest transaction: 0.58 Shortest transaction: 0.11
Office 最近有重大安全性更新,我沒有讓 Office 365 和 Windows Update 綁一起,所以必須手動更新。手動更新的位置被放在很意外的地方: