PikaCourse / homiehomie

3 stars 0 forks source link

[BUG] Webpack compilation takes too much memory #45

Closed William-An closed 3 years ago

William-An commented 3 years ago

What is this bug related to?

frontend

How urgent is the bug?

Should be fixed within the next version (after alpha v1) development cycle

Describe the bug

  1. webpack build production process took as high as 43% memory on the test sever with 2GB RAM, which result only ~30MB available RAM for the system
  2. Due to the insufficient RAM, the build process often fail and requires manual intervention to free other process in order to supply enough RAM for build process.

To Reproduce

  1. Rebuild the application on test server

Expected behavior

  1. Build should not fail due to insufficient memory
  2. No manual intervention is needed for the auto deployment process

Additional context

Possible resource: https://webpack.js.org/guides/build-performance/

William-An commented 3 years ago

Another possible helpful article from box: https://blog.box.com/how-we-improved-webpack-build-performance-95

William-An commented 3 years ago

Update: insufficient memory might due to the app and db taking about ~1GB of RAM and other two applications take about ~200MB, leaving the system insufficient memory to run build scripts

William-An commented 3 years ago

Resloved, use GitHub action to build the script and upload to server via scp