mirror of
https://github.com/discourse/discourse.git
synced 2025-04-17 10:25:51 +08:00

We preload to ensure as much memory as possible is reused from unicorn master to various workers using copy-on-write (sidekiq, unicorn) This migrates the preloading code into the Discourse module for easier reuse and adds 3 notable preloading changes 1. We attempt to localize a string on each site, ensuring we warmup the i18n 2. We preload all our templates (compiling .erb to class) 3. We warm-up our search tokenizer which uses cppjieba which is a large memory consumer, this will only cause a warmup on CJK sites or sites with the special site setting enabled.