Skip to content
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

Fix startup issues and timing with Examine and Nucache #10182

Merged
merged 9 commits into from
Jun 4, 2021

Conversation

Shazwazza
Copy link
Contributor

@Shazwazza Shazwazza commented Apr 26, 2021

This fixes #8893 and refactors #9859.

  • Moves logic for cold boot into the components responsible for what needs to happen in cold boot. This used to be in callbacks in DatabaseServerMessenger.
  • Removes the callbacks from DatabaseServerMessenger and obsoletes these callbacks.
  • Ensure examine rebuilds don't occur until the first http request is done instead of on a timer which could be problematic with cold boots. A reason for the Examine rebuilds the indexes on startup before custom fields or transformers are registered #8893 can be that during cold boots, the cold boot processing would take more than 5 seconds and then after those 5 seconds indexing occurs and this will happen before custom components execute that customize those indexes.
  • PublishedSnapshotService now only initializes lazily when it's needed.
  • Removes BatchedDatabaseServerMessenger.Startup, startup logic is just done in the component along with events.

The whole way that startup/init is done in v8 is not ideal but we are stuck with backwards compat. Once main problems is that nucache (PublishedSnapshotService) does it's init in it's ctor which doesn't leave much flexibility with how the init process works. This will be fixed/changed in netcore (if not already, I know some of it is).

Testing

To force a cold boot, just delete the /TEMP/DistCache folder, then restart your app, this will cold boot.

nzdev and others added 5 commits February 21, 2021 20:45
Reduce cold boot times by loading content and media only once on cold boot
…old boot into the components responsible for what needs to happen in cold boot. This is still not ideal but we are stuck with backwards compat. In netcore the initialization will be fixed up (if not already). Ensure examine rebuilds don't occur until the first http request is done instead of on a timer which could be problematic with cold boots.
@Shazwazza
Copy link
Contributor Author

Hi @nzdev, if you have anytime at all can you please cast your eye over this one? It refactors your work a little and ensures that cold boot logic is done by the components/classes that manage their data (i.e. removed all those init callbacks).

@nzdev
Copy link
Contributor

nzdev commented May 3, 2021

@Shazwazza this has some test failures.

@nzdev
Copy link
Contributor

nzdev commented May 5, 2021

Bugfix for the test @Shazwazza #10227

@Shazwazza
Copy link
Contributor Author

The logic for this has been updated. Initialization is all done lazily (like we do in v9). There is no more Booting event since it's unnecessary.

@bergmania
Copy link
Member

bergmania commented Jun 2, 2021

NuCache.Media.db still seems to be rebuilt on non-cold boots?

Update: - It seems to only happen because I did not have any media.

@Shazwazza
Copy link
Contributor Author

Update: - It seems to only happen because I did not have any media.

I think that's because it thinks its empty so it rebuilds? I'm guessing its the same thing in v8 but would have to check

@bergmania
Copy link
Member

I think that's because it thinks its empty so it rebuilds? I'm guessing its the same thing in v8 but would have to check

This is what happens.. I don't think that's a big problem, as it is super cheap when it is empty :)

I'm fine with merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/performance Fixes for performance (generally cpu or memory) fixes release/8.15.0 type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examine rebuilds the indexes on startup before custom fields or transformers are registered
4 participants