-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for Ember FastBoot #1811
Comments
We also need to get an estimate of the additional load we impose on our servers for rendering the pages – we may need to switch to bigger dynos. |
@locks directed me here to chime in. I'm from the ember learning team & I manage the API docs which runs on fastboot. We use one 2x dyno & we tunnel all our traffic to thar app via fastly. If you'd like more detailed stats reach out to me on discord & I'll be able to share them. |
Regarding the additional load, it would be helpful to share the stats about the endpoints. I assume that |
Less than 1% of our traffic is from browsers. I'd be shocked if we needed to increase server capacity as a result of this. |
That's definitely less than I expected. The additional server process we will be running will still consume some memory, regardless of whether it receives any requests, so we should at least take a look at that. |
Do we have control over the logs fastboot produces? It'd be nice if it could match the format of our previous logs. Before fastboot it would look like:
Now we have:
We should at least have the same amount of information that was present before. It'd be nice to put some identifier in the log I can filter on to only see requests handled by fastboot as well |
@sgrif - How much increase have you observed in the production environment? My change adds 2 node processes (foreman and the actual ember server), and it is super helpful to know which one is contributing how much. |
I observed roughly another 300MB from hitting /policies repeatedly before rolling back the deploy, so a total of 600MB difference from the previous deploy. I don't have per-process statistics. |
300MB for keeping the processes + 300MB per request? Wow, that's a lot. Do we have some limits regarding the memory consumption? There is a Heroku wiki about Node's memory usage and I will try to tune what we have. Regarding memory consumption, do you have some numbers we need to hit? Adding Node and loading Ember there definitely consume more memory, compared to having just a cargo server. If the minimal Node + Ember setups hits the limits, we probably need to give up Fastboot and try something else. |
Not per-request, that was the total increase in usage I saw after a few hundred requests. Our limit is 512MB, but honestly if this is using more than 100-150MB I will be extremely uncomfortable |
I think that 512MB is coming from Heroku's Standard 1X Dyno. Would it be able to upgrade our Dyno to more powerful one, since the server is doing more work for more features? If we cannot change our dyno and cannot hit the 150MB goal, we need to give up Fastboot. |
Let's see where we're at after someone investigates the memory usage in more depth |
Reducing the number of the child processes fastboot-app-server starts seems the way to go. From Node's perspective, Heroku's dyno has 8 cores and fastboot-app-server starts 8 child processes, which Heroku specifically says "a common mistake". https://devcenter.heroku.com/articles/node-memory-use#running-multiple-processes
|
I've updated the tracking issue to include aligning the FastBoot logs with our existing backend log format. |
@jtgeibel Also please uncheck/update about Can I be a collaborator on this repo? So I can keep this issue up-to-date. |
I've deployed #1886! |
Regarding logs, does the Rust backend write "at=info..." lines? My understanding is that the logs are coming from Heroku's router and won't be changed by ourselves.
|
The Rust backend writes some of the "at=info" lines, the ones that say |
(the PR we are working right now is #1900. I cannot edit the TODO list on the top...) Okay. I will do something similar on Fastboot-side at the end of an request as well. The log stream might be messed up by sharing the same stdin between 2 processes. Not so sure they are doing per-line buffering. I think it is okay for |
We are using a cookie in general to keep a session logged in managed by the conduit-cookie crate and used here. There is also an |
Emit Heroku-like logs from the Fastboot server This change adds Heroku-like logs from the Fastboot server, as we discussed in #1811.
#1912 covers |
#1937 will fix |
Regarding HTTP headers, here is what Fastboot sends:
Here is what the backend sends:
Right now both crates.io/config/nginx.conf.erb Line 117 in e218804
Copying them to the FastBoot server means that we have three places to maintain regarding HTTP headers, which I'd like to avoid if we can. |
I've updated the issue to track progress and reference the relevant PRs. I'd be okay with splitting the remaining items out to track via the Projects tab if you like. Thanks for investigating the headers. I agree, that we should probably consolidate everything into nginx. From what I recall, it can be a bit tricky when using
So this might result in some duplication in the nginx configuration file as well, but if that comes up then at least the ERB template can help deal with that and the logic is consolidated in a single place. We'll also want to examine which headers need the |
Okay. The header changes are in #2100. |
The |
Hi! I'm thinking about the next deployment strategy. We technically can enable How about enabling Fastboot for non-authenticated (means no cookies) requests? Seems Bing and DuckDuckGo don't index crates.io so far. So, enabling FastBoot for non-authenticate requests allows
What do you think? |
We have tested the fastboot implementation a few years ago and saw a significant performance decrease on the server and much higher memory usage. At this point it is probably safe to say that we will not work on server-side rendering with the current Ember.js frontend stack anymore and instead focus our efforts on evaluating and implementing alternatives. |
Recently I've been experimenting with the FastBoot PR, and below is my attempt at capturing the work that I think remains to enable FastBoot across the site.
Enable FastBoot for some static pages
As we previously discussed, the existing PR allows us to land support on a single static page to try this out in production:
/policies
- added in Enable Fastboot with USE_FASTBOOT environment variable set to 1 #1900Groundwork for enabling FastBoot on dynamic pages
Some tasks that I think will be necessary support more dynamic cases:
<noscript>
message only on pages that haven't been converted yet. - Tweak <noscript> text and placement #2101 tweaks the message and placement, but leaves the message present on all pages.ember-data-storefront
added in Don't make duplicated requests through Ember Data #2087/does-not-exist
) or resources (/crates/does-not-exist
) that don't exist, should respond with status 404 instead of 200.User-Agent
header to backend in fastboot mode #2048Page specific bugs
Following are bugs I observed while testing with JS off:
/
- Data doesn't load - fixed in Make / work under FastBoot #1937/login
- TypeError: window.open is not a function/logout
- completely blank pagegithub_login
,/authorize/github
- Unclear how the login workflow should work without JS, or if we should even support that/crates/test-crate
,/crates/test-crate/0.1.5
- "Authors" and "Owners" sections are not populated/crates/*/download
- I think this endpoint can be removed, it doesn't have an associated route file in the frontend/me/*
,/dashboard
- redirects to/
/{categories,keywords,users,teams}/does-not-exist
- results in a 500 server error/search
- doesn't load any search results/install
- a redirect which doesn't work with JS disabled, would be nice to do an HTTP redirect - added in Make /install work under FastBoot #1912The text was updated successfully, but these errors were encountered: