iftechfoundation / ifcomp

The software behind the Interactive Fiction Competition.
Other
23 stars 13 forks source link

The Docker instance renders _very_ slowly at first #424

Open dfabulich opened 2 months ago

dfabulich commented 2 months ago
  1. docker compose down && docker compose up --build
  2. Navigate to http://localhost:13000/

The page will take 60-90 seconds to load. My CPU usage is low. It seems like something's configured incorrectly.

Despite that, the Docker console logs say that everything rendered very quickly. For the 60-ish seconds that I'm waiting, there's no mention the console log that the GET request happened at all, until right at the very end, when it spits out this:

app-1  | '-------------------------------------+--------------------------------------'
app-1  |
app-1  | [info] IFComp powered by Catalyst 5.90131
app-1  | HTTP::Server::PSGI: Accepting connections at http://0:3000/
app-1  | [info] *** Request 1 (0.011/s) [25] [Tue Sep  3 20:26:17 2024] ***
app-1  | [debug] Path is "/"
app-1  | [debug] "GET" request for "/" from "192.168.65.1"
app-1  | [debug] Found sessionid "415df4dc1c2632574047f5f4d61dcc770cfca424" in cookie
app-1  | [debug] Deleting session(session expired)
app-1  | [debug] Rendering template "welcome.tt2"
app-1  | [debug] Response Code: 200; Content-Type: text/html; charset=utf-8; Content-Length: unknown
app-1  | [info] Request took 0.10964s (9.121/s)
app-1  | .------------------------------------------------------------+-----------.
app-1  | | Action                                                     | Time      |
app-1  | +------------------------------------------------------------+-----------+
app-1  | | /index                                                     | 0.002538s |
app-1  | | /end                                                       | 0.095822s |
app-1  | |  -> IFComp::View::HTML->process                            | 0.043914s |

But, that's not all.

  1. Click the "Sign in / Register" button in the header, taking you to http://localhost:13000/auth/login
  2. Sign in as curator@example.com / fool
  3. Navigate to http://localhost:13000/comp/2024/cover_sheet

This page also takes 60-90 seconds to load, at least for the first three or four times you try to load it. Again, the Docker console is silent, until right at the end when it says everything happened quickly. Quiet CPU. No sign of what I'm waiting on.

app-1  | | Action                                                     | Time      |
app-1  | +------------------------------------------------------------+-----------+
app-1  | | /index                                                     | 0.000390s |
app-1  | | /end                                                       | 0.008615s |
app-1  | |  -> IFComp::View::HTML->process                            | 0.005051s |
app-1  | '------------------------------------------------------------+-----------'
app-1  |
app-1  | [info] *** Request 5 (0.016/s) [25] [Tue Sep  3 20:29:50 2024] ***
app-1  | [debug] Path is "/comp/cover_sheet"
app-1  | [debug] "GET" request for "comp/2024/cover_sheet" from "192.168.65.1"
app-1  | [debug] Found sessionid "cd5b9797d1855ff10d926c241e4e215819fc7973" in cookie
app-1  | [debug] Restored session "cd5b9797d1855ff10d926c241e4e215819fc7973"
app-1  | [debug] Role granted: curator
app-1  | [warn] No user_id_cookie_key configured! I will not set a userid cookie.
app-1  | [debug] Rendering template "comp/cover_sheet.tt"
app-1  | [debug] Response Code: 200; Content-Type: text/html; charset=utf-8; Content-Length: unknown
app-1  | [info] Request took 0.074532s (13.417/s)
app-1  | .------------------------------------------------------------+-----------.
app-1  | | Action                                                     | Time      |
app-1  | +------------------------------------------------------------+-----------+
app-1  | | /comp/fetch_comp                                           | 0.003006s |
app-1  | | /comp/cover_sheet                                          | 0.013168s |
app-1  | | /end                                                       | 0.049011s |
app-1  | |  -> IFComp::View::HTML->process                            | 0.047403s |
app-1  | '------------------------------------------------------------+-----------'
mjmusante commented 2 months ago

update: on slack, we discovered that it's much faster on dan's config to use the 8080 port (the "web" instance) instead of the 13000 port (the "app" instance)