A user is seeking advice on how to temporarily use network storage for database restores and Postgres upgrades on a space-constrained VPS. The discussion explores various solutions, including migrating to a new VM, using a manual upgrade method that requires less space, and optimizing storage usage. While network storage can be used for uploads or backups, it’s not recommended for the database due to performance issues. The user’s database is 230GB, making in-place upgrades challenging, and the community suggests restoring to a new server to avoid downtime and ensure a smooth upgrade. The conversation also touches on the importance of vacuuming the database to free up space.
אנחנו מריצים התקנת Discourse גדולה יותר על גבי הגדרת VPS שעובדת לנו בעצם מצוין. מבחינת ביצועי CPU/זיכרון יש לנו מרווח. שטח דיסק הוא קצת בעיה - לא בעסקים השוטפים, אבל כשזה מגיע לשדרוג Postgres למשל (שדרוג מ-13 ל-15 תלוי ועומד בגלל זה) חסר לנו המקום ולא יכולים להרחיב בקלות.
אני יודע שיש אפשרויות אחרות לעדכון postgres אבל תחשבו על זה יותר כשאלה כללית.
אנחנו רצים על Hetzner שבה אחסון רשת זמין בקלות לשימוש זמני.
בשרת הבדיקות שלנו אני משחק עכשיו עם לגרום לזה לעבוד בצורה זמנית - קודם כל כדי לשחזר גיבוי מהאתר החי, אחר כך כדי לבדוק את שדרוג Postgres. עד כה לא הצלחתי.
ניסיתי כבר לעשות symlinking אבל שמתי לב שזה לא עבד וגם קראתי כאן איפשהו שזה לא הדרך המומלצת. ניסיתי גם להעביר את השיתוף /shared מ-/var/discourse/shared/standalone ל-/mnt/ext-storage/standalone והעברתי את הקבצים לשם - לצערי לא בלי בעיות. אני אפילו לא יכול לסיים את הבנייה.
האם יש דרך שעובדת למקרים כאלה? אני מודע לכך שביצועי הכונן גרועים בהרבה מהכונן המקומי אבל אני לא מתכנן להריץ את הפורום עליו. אני באמת רק רוצה שתהיה לי דרך נוחה להשתמש בו לתרחישים מסוימים.
If your goal is to do the upgrade the easiest thing is to spin up a new vm and migrate to it. You skip the need to upgrade the database and you get a new os on your vm, which you likely need to do anyway.
Actually this is not an option. It’s not running out of space for day to day needs anyways. Also we’re on a 600gb drive space right now and using ~50%. There is not a bigger option - at least not on Hetzner.
That’s why i explicitly was asking for the external drive.
It can be handy to keep your uploads, or, say /var/discourse/shared/web_only on network storage. You need to edit the yml file to point to it rather than use a symlink (the symlink doesn’t work because the container can’t access the place that your symlink points to.
Then if you do move to a new vm, you can just remount that network storage rather than copy it over.
I don’t recommend network storage for the database since it’s slower.
I think it’s worthwhile breaking down what your usage is. Your actual database size might not be so large, if most of your usage is uploads, and it’s only the database part which demands maybe 3x space during upgrade.
One thing you can check is the relative size of a backup with downloads compared to a backup without downloads.
Or, use the command line. Here’s some output from my rather small forum:
I think it’s supposed to. I am not clear what triggers it. I think doing an extra one doesn’t hurt and might save you some space. It’s recommended after you do the upgrade if you do it in place. I’ve seen it clean up considerable space a few times.
If your database is 230GB, I’d definitely restore it to a new server. Downtime reading and writing 230GB is going to be significant.