Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ecosystem.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ module.exports = {
COMPUTE_MODE: 'local',
ALWAYS_ON: 'true'
}
},
{
name: 'project-genie',
script: './scripts/genesis.cjs',
autorestart: true,
watch: false,
max_memory_restart: '300M',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The memory limit of 300M is relatively low for a process performing 'continuous building' tasks. Node.js build processes (even simulated ones) often require significant heap memory for operations like file processing or AST manipulation. If the process exceeds this limit, PM2 will restart it, which could lead to a crash loop and instability. Consider increasing this to 512M or 1G to provide more headroom.

      max_memory_restart: '512M',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The memory limit of 300M is quite restrictive for a process described as performing "continuous building". Node.js build toolchains and complex simulations can easily exceed this threshold, which would cause PM2 to restart the process unexpectedly. Increasing this to 1G (or at least 512M) would provide better stability for these types of workloads.

      max_memory_restart: '1G',

restart_delay: 5000,
env: {
GENESIS_LOOP: 'true',
FORCE_MUTATION: 'true',
ALWAYS_ON: 'true'
}
Comment on lines +118 to +122
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the core services defined in this configuration (see line 107), the COMPUTE_MODE environment variable should be included. Since this is a "local simulation", setting it to local ensures that the project-genie process operates within the same environment context as the rest of the application stack.

      env: {
        COMPUTE_MODE: 'local',
        GENESIS_LOOP: 'true',
        FORCE_MUTATION: 'true',
        ALWAYS_ON: 'true'
      }

}
]
};