bar10dr
29 באפריל, 2025, 5:59pm
1
After updating to the latest version of Discourse we now have a strange issue with ngix posting error 502.
Some users get Error 502 when posting, some don’t. Some profiles get 502, some don’t.
CPU usage is around 10 to 25%, RAM usage is about 20% as well.
I tried disabling our 5 plugins, same result.
What logs do I look at to find out what is producing these 502 errors?
bar10dr
29 באפריל, 2025, 6:13pm
3
Looking in I /var/log/nginx/error.log I seem to randomly get a lot of these, which produces the 502 I assume.
Its just timing out or what?
2025/04/29 18:11:50 [error] 617#617: *419 upstream prematurely closed connection while reading response header from upstream, client: <IP>, server: _, request: "POST /posts HTTP/2.0", upstream: "http://127.0.0.1:3000/posts", host: "forum.domain.com", referrer: "https://forum.domain.com/"
RGJ
(Richard - Communiteq)
29 באפריל, 2025, 6:15pm
4
What was the version prior to the update?
bar10dr
29 באפריל, 2025, 6:24pm
5
Really old, like a year old or more. Is there a log somewhere I can see what I upgraded from?
bar10dr
29 באפריל, 2025, 6:40pm
6
Also getting some of these
*2 connect() failed (111: Connection refused) while connecting to upstream,
...
upstream: "http://127.0.0.1:3000/message-bus/92fd28cbf742...
It seems random, suddenly everything is fast and I can post again, and then it goes slow and 502’s start popping up again.
bar10dr
29 באפריל, 2025, 6:52pm
7
מסתכלים בתוך יומן ה- postgres/current
2025-04-29 18:48:24.709 UTC [1746] discourse@discourse LOG: זמן ריצה: 606789.911 מ״ל ביצוע בלי שם: SELECT COUNT(*) FROM "posts" WHERE "posts"."deleted_at" IS NULL
time: 606789.911 מ״ל
יש לנו הרבה פוסטים, מעט משתמשים.. מדוע זה לוקח 600k מ״ל על זה?
bar10dr
29 באפריל, 2025, 7:13pm
8
Might it be problems with indexing or such, that makes the queries slow?
bar10dr
29 באפריל, 2025, 7:21pm
9
I selected the discourse table in postgres and did a REINDEX DATABASE discourse; in the hope of that making things faster.
I assume it will take a very long time.
pfaffman
(Jay Pfaffman)
29 באפריל, 2025, 7:39pm
10
Did you follow the advice in PostgreSQL 15 update ? You might also vaccuum the database.
bar10dr
29 באפריל, 2025, 7:51pm
11
אני לא, יש לי את התיקייה postgres_data_old (אם כי באותה תקייה שונה מהפוסט ההוא).
אבל אז הפוסט אומר;
“אם אתה מריץ הגדרה עם מכולת נתונים ייעודית” which אני מניח פירושו שפורצער רץ במכולת Docker ייעודית?
השלנו רצות באותה מופעלת כמו הפורום. אז לא בטוח איך להמשיך משם כי אין נראה שיש תנאי “אם לא”?
האם קיומו של התיקייה אומר שההמרה הייתה בסדר או שאולי צריך משהו אחר?"}}the{
pfaffman
(Jay Pfaffman)
29 באפריל, 2025, 7:56pm
12
אתה יכול לבדוק את גרסת ה-Postgres ב-/var/discourse/shared/standalone/postgres_data/PG_VERSION – אם ביצעת שדרוג משורת פקודה, ייתכן שזה ביצע את השדרוג ואתה לא שמת לב (אבל היית צריך להפעיל את הבנייה מחדש פעמיים). אם שידרגת מواجهة האינטרנט, סביר להניח שכדאי לך לעשות את הבנייה מחדש משורת הפקודה אם מערכת ההפעלה שלך ו-Docker הם גרסאות עדכניות.
bar10dr
29 באפריל, 2025, 8:08pm
13
Verson is 15.
It seems things are a lot better after I ran the vaccuum command.
Posting works fine and seems to be fast, but when admin try clicking user profiles, go into their profiles, it still 502’s, time out it seems like?
Is there something I can do to speed up that portion of the db?
system
(system)
נסגר ב־
29 במאי, 2025, 8:08pm
14
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.