I’m seeing my projections fault occasionally with the message: “Message: Failed to compile script. Script execution terminated. Timeout expired. (1)”
I’ve just been restarting them which seems to work fine but is not a great solution.
They are not doing anything complicated but I think maybe the length of the projection is causing the compiler to complain? Heres an example - all it does it link events my elastic consumer is interested in to a unique stream for them to compete consume from.
fromStreams([
‘$et-event1, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event2, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event3, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event4, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event5, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event6, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event7, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event8, Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event9, Models, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event10, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event11, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event12, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event13, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event14, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event15, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event16, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event17, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event18, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’,
‘$et-event19, Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’])
.when({
‘event1, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event2, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event3, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event4, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event5, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event6, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event7, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event8, Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event9, Models, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event10, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event11, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event12, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event13, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event14, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event15, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event16, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event17, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event18, Domain.Messages, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); },
‘event19, Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’: function(s,e) { linkTo(‘application.elastic.development.0.1.0.0’, e); }
});
``
While processing these projections my instance is running about 3-5k (peak 11k) items a second, 3 of these projections each writing ~30 events / second, and each with 4 pinned consumers. In my eventstore instance i’ve given it 12 cores and upped the thread counts in the config. WorkerThreads: 8, ProjectionThreads: 4, CachedChunks: 8, and ChunksCacheSize: 4294967296
It runs at ~50% cpu sometimes spiking up to 100% for a few moments
Anything look out of place? I don’t know if the projection itself is the wisest thing actually it just makes sense given my consumers don’t need to see everything in $all