# 저메모리 환경에서 JS 빌드 시간 개선 (2024년 5월)

**URL:** https://meta.discourse.org/t/improvements-to-js-build-times-in-low-memory-environments-may-2024/306462
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [5월 2, 2024, 11:01오전 UTC](https://meta.discourse.org/t/improvements-to-js-build-times-in-low-memory-environments-may-2024/306462 "2024-05-02T11:01:20Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [5월 2, 2024, 11:01오전 UTC](https://meta.discourse.org/t/improvements-to-js-build-times-in-low-memory-environments-may-2024/306462/1 "2024-05-02T11:01:20Z")

</div>

공식 설치 가이드에서는 Discourse의 최소 요구 사양으로 RAM 1GB(+스왑 2GB)를 명시하고 있습니다. 여전히 실행은 가능하지만, 지난 몇 달간 이 사양의 서버에서 Discourse를 다시 빌드하는 것이 점점 더 어려워지고 있습니다. 이는 주로 JS 빌드 도구 관련 변경 사항 때문입니다.

최근 다음 조정을 적용했으며, 이는 저메모리 서버의 재빌드 시간을 상당히 개선해야 합니다:

> <https://github.com/discourse/discourse/commit/9db5eafb15688cf0604805fb5b315efca1c712a6>
>
> \- Use 'cheap-source-map' webpack config on low-memory machines
> 
> This results… in worse quality sourcemaps in browser dev tools, but it significantly reduces memory use in our webpack build. In approximate local testing it drops from 1100mb to 590mb. This should make the rebuild process on low-memory machines much faster and less likely to trigger OOM errors.
> 
> In development, and on higher-memory machines, the higher-quality 'source-map' option is maintained.
> 
> \- Disable Webpack's built-in \`minimize\` feature. Embroider already applies Terser after the webpack build is complete. There is no need to double-minimize the output.
> 
> \- Update ember-cli-progress-ci to print to stderr instead of stdout. For some reason, pups (used by discourse\_docker) buffers the stdout of commands and only prints when they are finished. stderr does not have this same limitation, so switching will mean sysadmins can see the progress of the ember build in real-time.
> 
> Given the number of variables it's hard to promise exact numbers. But, in my tests on a DO droplet with 1GB RAM (+2GB swap), this reduced the \`ember build\` portion of a \`./launcher rebuild app\` from ~50 minutes to ~15 minutes.

변수 요소가 많아 정확한 수치를 보장하기는 어렵습니다. 하지만 RAM 1GB(+스왑 2GB)의 DO 드롭렛에서 진행한 제 테스트에 따르면, `./launcher rebuild app`의 `ember build` 부분이 약 45분에서 약 15분으로 줄었습니다.

더 많은 RAM을 가진 머신에서도 약간의 속도 향상이 있을 수 있지만, 큰 차이는 없을 것입니다.

저메모리 머신에서 Discourse를 실행하고 계신다면, 직접 시도해 보시고 결과를 알려 주시기 바랍니다!

---

_[View the full topic](https://meta.discourse.org/t/improvements-to-js-build-times-in-low-memory-environments-may-2024/306462)._
