我有一个Nuxt应用程序正在部署到Heroku。
部署后,它会构建nuxt应用程序,我可以在Heroku指标中看到它收到9个H10
应用程序崩溃事件,3个R10
启动超时事件,2个R14
引用超过了内存配额,同时1 H20
代表应用程序启动超时。
我对造成这种情况的原因感到困惑。该应用程序最终会启动并运行,并且看起来很稳定,但是从指标来看,它显然每24小时崩溃10至50次。
在package.json脚本中,我在nuxt build
中尝试过heroku-postbuild
我尝试升级以重新启动测功机
package.json
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"generate": "nuxt generate",
"start": "nuxt build && nuxt start",
"precommit": "npm run lint",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"heroku-postbuild": "npm run build"
},
"engines": {
"node": "8.3.0",
"npm": "5.6.0"
},
在应用程序崩溃时从Heroku登录:
heroku logs --tail
2019-01-19T01:46:57.991132+00:00 app[web.1]: ℹ Production build 01:46:57
2019-01-19T01:46:58.059252+00:00 app[web.1]: ✔ Builder initialized 01:46:58
2019-01-19T01:46:58.176129+00:00 app[web.1]: ✔ Nuxt files generated 01:46:58
2019-01-19T01:46:59.686058+00:00 app[web.1]: ℹ Compiling Client webpackbar 01:46:59
2019-01-19T01:47:46.103022+00:00 heroku[web.1]: Process running mem=623M(121.8%)
2019-01-19T01:47:46.103244+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2019-01-19T01:47:50.552033+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-01-19T01:47:50.552033+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-01-19T01:47:50.736976+00:00 heroku[web.1]: State changed from starting to crashed
2019-01-19T01:47:50.718148+00:00 heroku[web.1]: Process exited with status 137
2019-01-19T01:48:01.676902+00:00 heroku[web.1]: Starting process with command `npm start`
2019-01-19T01:48:04.961372+00:00 app[web.1]:
2019-01-19T01:48:04.961400+00:00 app[web.1]: > sms-funnel@1.0.0 start /app
2019-01-19T01:48:04.961402+00:00 app[web.1]: > nuxt build && nuxt start
2019-01-19T01:48:04.961404+00:00 app[web.1]:
2019-01-19T01:48:08.315916+00:00 app[web.1]: ✔ Nuxt files generated 01:48:08
2019-01-19T01:48:09.662745+00:00 app[web.1]: ℹ Compiling Client webpackbar 01:48:09
2019-01-19T01:48:59.310099+00:00 app[web.1]: ✔ Server: Compiled successfully in 13.44s webpackbar 01:48:59
2019-01-19T01:48:59.311616+00:00 app[web.1]:
2019-01-19T01:48:59.311619+00:00 app[web.1]: Hash: 297bf7dde8c2173fe587
2019-01-19T01:48:59.311621+00:00 app[web.1]: Version: webpack 4.28.1
2019-01-19T01:48:59.311623+00:00 app[web.1]: Time: 36187ms
2019-01-19T01:48:59.311625+00:00 app[web.1]: Built at: 2019-01-19 01:48:45
2019-01-19T01:48:59.311627+00:00 app[web.1]: Asset Size Chunks Chunk Names
2019-01-19T01:48:59.311629+00:00 app[web.1]: 1e266a975b8e489e7157.js 10.7 KiB 5 [emitted] pages/apply/_apply
2019-01-19T01:48:59.311631+00:00 app[web.1]: 228361f13e6ed582073a.js 26.3 KiB 1 [emitted] pages/indexRating.pages/score.pages/scorequestions/_scoreQuestions
2019-01-19T01:48:59.311633+00:00 app[web.1]: 275fdd7ac287b79b8e4a.js 13 KiB 18 [emitted] pages/success
2019-01-19T01:48:59.311634+00:00 app[web.1]: 2ef7b1a281264ada068b.js 20.6 KiB 13 [emitted] pages/questions/_questions
2019-01-19T01:48:59.311636+00:00 app[web.1]: 482c88043074fa847ae3.js 13.4 KiB 8 [emitted] pages/good
2019-01-19T01:48:59.311638+00:00 app[web.1]: 4a3f2a639a4cd8a87ec5.js 10.5 KiB 11 [emitted] pages/mgmt/_feedback
2019-01-19T01:48:59.311639+00:00 app[web.1]: 4c1dd70e6f96ca88050c.js 5.57 KiB 10 [emitted] pages/indexRating
2019-01-19T01:48:59.311641+00:00 app[web.1]: 5139169efaa2c223eb42.js 17.4 KiB 19 [emitted] pages/welcome
2019-01-19T01:48:59.311643+00:00 app[web.1]: 57f74b1d32fdb5fbe90c.js 10.8 KiB 17 [emitted] pages/sms/_sms
2019-01-19T01:48:59.311645+00:00 app[web.1]: 5d36a2644de53ea362c7.js 1.28 KiB 4 [emitted] pages/_id
2019-01-19T01:48:59.311659+00:00 app[web.1]: 64a810f5c2919df4ab8b.js 4.84 KiB 15 [emitted] pages/score
2019-01-19T01:48:59.311661+00:00 app[web.1]: 69eb1c6996a711322f65.js 9.92 KiB 7 [emitted] pages/feedback
2019-01-19T01:48:59.311662+00:00 app[web.1]: 865f286027f1fa6681fa.js 150 KiB 3 [emitted] commons.app
2019-01-19T01:48:59.311664+00:00 app[web.1]: 905c239dec3c408fae0e.js 13.5 KiB 9 [emitted] pages/index
2019-01-19T01:48:59.311671+00:00 app[web.1]: 9218e736b3c261c59884.js 11.8 KiB 0 [emitted] commons.pages/_id.pages/apply/_apply.pages/bad.pages/feedback.pages/good.pages/mgmt/_feedback.pages/.b499558b
2019-01-19T01:48:59.311672+00:00 app[web.1]: LICENSES 847 bytes [emitted]
2019-01-19T01:48:59.311674+00:00 app[web.1]: a36af3c6bc313bf0e4c3.js 24.3 KiB 21 [emitted] vendors.app
2019-01-19T01:48:59.311676+00:00 app[web.1]: a9ef600fa1fe989d4671.js 9.91 KiB 12 [emitted] pages/okay
2019-01-19T01:48:59.311677+00:00 app[web.1]: b31a945fb037dff05f97.js 19.7 KiB 14 [emitted] pages/questions2/_questions
2019-01-19T01:48:59.311679+00:00 app[web.1]: b46f1c2dc20f9e2f33fa.js 9.98 KiB 6 [emitted] pages/bad
2019-01-19T01:48:59.311681+00:00 app[web.1]: d0fe836b07bdaa42f565.js 3.49 KiB 16 [emitted] pages/scorequestions/_scoreQuestions
2019-01-19T01:48:59.311682+00:00 app[web.1]: d9eb5346f080e591031b.js 2.57 KiB 20 [emitted] runtime
2019-01-19T01:48:59.311684+00:00 app[web.1]: f8f7400242217f19a2b4.js 40.4 KiB 2 [emitted] app
2019-01-19T01:48:59.311686+00:00 app[web.1]: fonts/029c2e0.woff2 27.4 KiB [emitted]
2019-01-19T01:48:59.311687+00:00 app[web.1]: fonts/67ea410.woff2 30.6 KiB [emitted]
2019-01-19T01:48:59.311688+00:00 app[web.1]: fonts/6c288c9.woff2 26.4 KiB [emitted]
2019-01-19T01:48:59.311690+00:00 app[web.1]: fonts/9470b32.woff2 30.6 KiB [emitted]
2019-01-19T01:48:59.311691+00:00 app[web.1]: fonts/94a505b.woff2 27.8 KiB [emitted]
2019-01-19T01:48:59.311700+00:00 app[web.1]: fonts/97ca950.woff2 27.9 KiB [emitted]
2019-01-19T01:48:59.311702+00:00 app[web.1]: fonts/bec3023.woff2 30.1 KiB [emitted]
2019-01-19T01:48:59.311703+00:00 app[web.1]: fonts/c8ae3e9.woff2 24.4 KiB [emitted]
2019-01-19T01:48:59.311705+00:00 app[web.1]: img/14137f8.svg 1020 bytes [emitted]
2019-01-19T01:48:59.311707+00:00 app[web.1]: img/1ee9dc3.svg 3.47 KiB [emitted]
2019-01-19T01:48:59.311708+00:00 app[web.1]: img/8def50a.png 11.6 KiB [emitted]
2019-01-19T01:48:59.311709+00:00 app[web.1]: img/b787c8c.png 25 KiB [emitted]
2019-01-19T01:48:59.311711+00:00 app[web.1]: img/ebd3fbd.svg 6.76 KiB [emitted]
2019-01-19T01:48:59.311712+00:00 app[web.1]: videos/d8ad35e.mp4 4.39 MiB [emitted] [big]
2019-01-19T01:48:59.311714+00:00 app[web.1]: + 3 hidden assets
2019-01-19T01:48:59.311717+00:00 app[web.1]: Entrypoint app = d9eb5346f080e591031b.js 865f286027f1fa6681fa.js a36af3c6bc313bf0e4c3.js f8f7400242217f19a2b4.js
2019-01-19T01:48:59.311719+00:00 app[web.1]:
2019-01-19T01:48:59.311721+00:00 app[web.1]: WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
2019-01-19T01:48:59.311723+00:00 app[web.1]: This can impact web performance.
2019-01-19T01:48:59.311724+00:00 app[web.1]: Assets:
2019-01-19T01:48:59.311726+00:00 app[web.1]: videos/d8ad35e.mp4 (4.39 MiB)
2019-01-19T01:48:59.311728+00:00 app[web.1]:
2019-01-19T01:48:59.311730+00:00 app[web.1]: Hash: 90d0dc57b8496249b04f
2019-01-19T01:48:59.311731+00:00 app[web.1]: Version: webpack 4.28.1
2019-01-19T01:48:59.311733+00:00 app[web.1]: Time: 13440ms
2019-01-19T01:48:59.311735+00:00 app[web.1]: Built at: 2019-01-19 01:48:59
2019-01-19T01:48:59.311736+00:00 app[web.1]: Asset Size Chunks Chunk Names
2019-01-19T01:48:59.311738+00:00 app[web.1]: server-bundle.json 1.28 MiB [emitted]
2019-01-19T01:48:59.311740+00:00 app[web.1]: Entrypoint app = server-bundle.js
2019-01-19T01:49:02.001917+00:00 heroku[web.1]: State changed from starting to crashed
2019-01-19T01:49:01.907338+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-01-19T01:49:01.907419+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-01-19T01:49:01.985335+00:00 heroku[web.1]: Process exited with status 137
2019-01-19T02:09:55.940635+00:00 heroku[web.1]: Starting process with command `npm start`
2019-01-19T02:09:59.204428+00:00 app[web.1]:
2019-01-19T02:09:59.204470+00:00 app[web.1]: > sms-funnel@1.0.0 start /app
2019-01-19T02:09:59.204471+00:00 app[web.1]: > nuxt build && nuxt start
2019-01-19T02:09:59.204473+00:00 app[web.1]:
2019-01-19T02:10:00.451831+00:00 app[web.1]:
2019-01-19T02:10:00.451868+00:00 app[web.1]: WARN vendor has been deprecated due to webpack4 optimization 02:10:00
2019-01-19T02:10:00.451870+00:00 app[web.1]:
2019-01-19T02:10:02.785788+00:00 app[web.1]: ℹ Production build 02:10:02
2019-01-19T02:10:02.870326+00:00 app[web.1]: ✔ Builder initialized 02:10:02
2019-01-19T02:10:03.010461+00:00 app[web.1]: ✔ Nuxt files generated 02:10:03
2019-01-19T02:10:04.546835+00:00 app[web.1]: ℹ Compiling Client webpackbar 02:10:04
2019-01-19T02:10:56.647914+00:00 heroku[web.1]: State changed from starting to crashed
2019-01-19T02:10:56.466798+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-01-19T02:10:56.467178+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-01-19T02:10:56.628663+00:00 heroku[web.1]: Process exited with status 137
2019-01-19T02:26:56.138062+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=extremeparts.herokuapp.com request_id=2548a645-62d3-450b-bc7c-88c4c2e76fed fwd="70.31.169.174" dyno= connect= service= status=503 bytes= protocol=https
2019-01-19T02:26:57.446142+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=extremeparts.herokuapp.com request_id=2019c4ef-e146-47d1-b8d3-26a2ef5e1e95 fwd="70.31.169.174" dyno= connect= service= status=503 bytes= protocol=https
2019-01-19T02:26:59.847962+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/sw.js" host=extremeparts.herokuapp.com request_id=babf39a3-fa25-43b6-921a-3ae067f0a5b2 fwd="70.31.169.174" dyno= connect= service= status=503 bytes= protocol=https
2019-01-19T02:27:57.182604+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/sw.js" host=extremeparts.herokuapp.com request_id=800ddc06-48f8-4469-bafa-2a818b19ddf2 fwd="70.31.169.174" dyno= connect= service= status=503 bytes= protocol=https