Здравствуйте!
Когда выпустил проект на продакшин, бывает такой сбой в ОС. И это бывает когда одновременно заходить не сколько человек на сайте
ОС Ubuntu 18.04
Node js 12
проект на Nuxt js работает(в режим SSR)
когда проверял сиситему на ЦП
оказалось Ноджс нагружает на систему и Nginx вернет ошибку 502
а в консоль вот такая ошибка
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x326f1d49e6e9 <JSObject>
0: builtin exit frame: clear(this=0x275b07722b61 <Set map = 0x2a9ed88841f9>,0x275b07722b61 <Set map = 0x2a9ed88841f9>)
1: get [0x23597456c931] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtime.common.prod.js:~6] [pc=0x16b4b178cbe2](this=0x275b07722a81 <un map = 0x293f53439679>)
2: new constructor(aka un) [0x287f49e2ce01] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtim...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8fa0c0 node::Abort() [node]
2: 0x8fa10c [node]
3: 0xb0026e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb004a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xef49b2 [node]
6: 0xef4ab8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xf00b92 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xf014c4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf04131 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xecd226 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
11: 0xecdaaa v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
12: 0xecdb50 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [node]
13: 0x1059b37 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [node]
14: 0x1059bf8 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Clear(v8::internal::Handle<v8::internal::OrderedHashSet>) [node]
15: 0x100dd83 v8::internal::JSSet::Clear(v8::internal::Handle<v8::internal::JSSet>) [node]
16: 0xba41f8 v8::internal::Builtin_SetPrototypeClear(int, v8::internal::Object**, v8::internal::Isolate*) [node]
17: 0x16b4b115bf7d
Aborted
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! IYB@1.0.0 start: `nuxt start --max_old_space_size=3072 --optimize_for_size`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the IYB@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dilik/.npm/_logs/2019-09-26T12_51_31_381Z-debug.log
и каждый раз по разному
<--- Last few GCs --->
[4394:0x3efba20] 50300 ms: Scavenge 1376.2 (1424.7) -> 1375.8 (1425.7) MB, 14.7 / 0.0 ms (average mu = 0.167, current mu = 0.072) allocation failure
[4394:0x3efba20] 51979 ms: Mark-sweep 1376.7 (1425.7) -> 1375.9 (1423.7) MB, 1665.8 / 0.0 ms (average mu = 0.118, current mu = 0.075) allocation failure scavenge might not succeed
[4394:0x3efba20] 51992 ms: Scavenge 1376.8 (1423.7) -> 1376.5 (1425.2) MB, 8.6 / 0.0 ms (average mu = 0.118, current mu = 0.075) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x12536f29e6e9 <JSObject>
0: builtin exit frame: ownKeys(this=0x12536f2940b9 <Object map = 0x32d4246850c1>,0x24bce7425879 <Object map = 0x3e5c4213a961>,0x12536f2940b9 <Object map = 0x32d4246850c1>)
1: /* anonymous */ [0x33efeb77c721] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtime.common.prod.js:~6] [pc=0x6e4b73529de](this=0x24bce7421229 <a map = 0xed4c9e78d39>)
2: arguments adaptor frame: 1->0
...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8fa0c0 node::Abort() [node]
2: 0x8fa10c [node]
3: 0xb0026e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb004a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xef49b2 [node]
6: 0xef4ab8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xf00b92 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xf014c4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf04131 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xecd226 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
11: 0xecdaaa v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
12: 0xecdb50 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [node]
13: 0x1059b37 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [node]
14: 0xfcf77f v8::internal::KeyAccumulator::AddKey(v8::internal::Handle<v8::internal::Object>, v8::internal::AddKeyConversion) [node]
15: 0xfd2569 v8::internal::KeyAccumulator::CollectOwnPropertyNames(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [node]
16: 0xfd2b24 v8::internal::KeyAccumulator::CollectOwnKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [node]
17: 0xfd37d5 v8::internal::KeyAccumulator::CollectKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSReceiver>) [node]
18: 0xfd3b06 v8::internal::KeyAccumulator::GetKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::KeyCollectionMode, v8::internal::PropertyFilter, v8::internal::GetKeysConversion, bool, bool) [node]
19: 0xbe2a4c v8::internal::Builtin_ReflectOwnKeys(int, v8::internal::Object**, v8::internal::Isolate*) [node]
20: 0x6e4b6fdbf7d
Aborted
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! IYB@1.0.0 start: `nuxt start --max_old_space_size=3072 --optimize_for_size`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the IYB@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dilik/.npm/_logs/2019-09-26T12_54_46_112Z-debug.log
попробовал увеличить память с
--max_old_space_sizeом но не помогло
подскажите пожалуйста, как решать данную проблему?