Something I noticed before the instance crashes is the following
DEFAULT 2023-04-19T20:16:34.234218061Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "SharedWorkflow"."workflowId" AS "SharedWorkflow_workflowId", "SharedWorkflow"."userId" AS "SharedWorkflow_userId", "SharedWorkflow__SharedWorkflow_workflow"."createdAt" AS "SharedWorkflow__SharedWorkflow_workflow_createdAt", "SharedWorkflow__SharedWorkflow_workflow"."updatedAt" AS "SharedWorkflow__SharedWorkflow_workflow_updatedAt", "SharedWorkflow__SharedWorkflow_workflow"."id" AS "SharedWorkflow__SharedWorkflow_workflow_id", "SharedWorkflow__SharedWorkflow_workflow"."name" AS "SharedWorkflow__SharedWorkflow_workflow_name", "SharedWorkflow__SharedWorkflow_workflow"."active" AS "SharedWorkflow__SharedWorkflow_workflow_active", "SharedWorkflow__SharedWorkflow_workflow"."nodes" AS "SharedWorkflow__SharedWorkflow_workflow_nodes", "SharedWorkflow__SharedWorkflow_workflow"."connections" AS "SharedWorkflow__SharedWorkflow_workflow_connections", "SharedWorkflow__SharedWorkflow_workflow"."settings" AS "SharedWorkflow__SharedWorkflow_workflow_settings", "SharedWorkflow__SharedWorkflow_workflow"."staticData" AS "SharedWorkflow__SharedWorkflow_workflow_staticData", "SharedWorkflow__SharedWorkflow_workflow"."pinData" AS "SharedWorkflow__SharedWorkflow_workflow_pinData", "SharedWorkflow__SharedWorkflow_workflow"."versionId" AS "SharedWorkflow__SharedWorkflow_workflow_versionId", "SharedWorkflow__SharedWorkflow_workflow"."triggerCount" AS "SharedWorkflow__SharedWorkflow_workflow_triggerCount", "SharedWorkflow__SharedWorkflow_role"."createdAt" AS "SharedWorkflow__SharedWorkflow_role_createdAt", "SharedWorkflow__SharedWorkflow_role"."updatedAt" AS "SharedWorkflow__SharedWorkflow_role_updatedAt", "SharedWorkflow__SharedWorkflow_role"."id" AS "SharedWorkflow__SharedWorkflow_role_id", "SharedWorkflow__SharedWorkflow_role"."name" AS "SharedWorkflow__SharedWorkflow_role_name", "SharedWorkflow__SharedWorkflow_role"."scope" AS "SharedWorkflow__SharedWorkflow_role_scope" FROM "n8n2"."shared_workflow" "SharedWorkflow" LEFT JOIN "n8n2"."workflow_entity" "SharedWorkflow__SharedWorkflow_workflow" ON "SharedWorkflow__SharedWorkflow_workflow"."id"="SharedWorkflow"."workflowId" LEFT JOIN "n8n2"."role" "SharedWorkflow__SharedWorkflow_role" ON "SharedWorkflow__SharedWorkflow_role"."id"="SharedWorkflow"."roleId"
DEFAULT 2023-04-19T20:16:34.270483125Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1337
DEFAULT 2023-04-19T20:16:34.308839587Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT COUNT(1) AS "cnt" FROM "n8n2"."execution_entity" "ExecutionEntity" WHERE ("ExecutionEntity"."workflowId" = $1 AND NOT("ExecutionEntity"."id" IN ($2, $3, $4, $5, $6, $7, $8, $9, $10))) -- PARAMETERS: [70,"87824","87825","87826","87827","87828","87829","87830","87831","87832"]
DEFAULT 2023-04-19T20:16:34.322493899Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1211
DEFAULT 2023-04-19T20:16:34.335499143Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT COUNT(1) AS "cnt" FROM "n8n2"."execution_entity" "ExecutionEntity" WHERE ("ExecutionEntity"."workflowId" = $1 AND NOT("ExecutionEntity"."id" IN ($2, $3, $4, $5, $6, $7, $8, $9, $10))) -- PARAMETERS: [70,"87824","87825","87826","87827","87828","87829","87830","87831","87832"]
DEFAULT 2023-04-19T20:16:34.338461066Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1017
DEFAULT 2023-04-19T20:16:34.620172585Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "execution"."id" AS "execution_id", "execution"."finished" AS "execution_finished", "execution"."mode" AS "execution_mode", "execution"."retryOf" AS "execution_retryOf", "execution"."retrySuccessId" AS "execution_retrySuccessId", "execution"."status" AS "execution_status", "execution"."startedAt" AS "execution_startedAt", "execution"."stoppedAt" AS "execution_stoppedAt", "execution"."workflowData" AS "execution_workflowData", "execution"."waitTill" AS "execution_waitTill" FROM "n8n2"."execution_entity" "execution" WHERE ("execution"."workflowId" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55, $56, $57, $58) AND id NOT IN ($59, $60, $61, $62, $63, $64, $65, $66)) AND "execution"."workflowId" = $67 ORDER BY id DESC LIMIT 20 -- PARAMETERS: ["49","50","51","52","53","54","55","56","8","11","14","15","16","19","22","23","24","26","27","31","33","34","37","40","42","44","2","3","5","7","9","10","20","21","29","32","36","38","39","41","43","45","46","48","57","59","60","61","62","63","65","66","67","68","69","70","71","72","87825","87826","87827","87828","87829","87830","87831","87832",70]
DEFAULT 2023-04-19T20:16:34.644474369Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1020
DEFAULT 2023-04-19T20:16:34.648557704Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: UPDATE "n8n2"."workflow_statistics" SET "count" = count + 1, "latestEvent" = $1 WHERE ("workflowId" = $2 AND "name" = $3) -- PARAMETERS: ["2023-04-19T20:16:33.566Z",11,"production_success"]
DEFAULT 2023-04-19T20:16:34.678505532Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1045
DEFAULT 2023-04-19T20:16:34.858951238Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "SharedWorkflow"."workflowId" AS "SharedWorkflow_workflowId", "SharedWorkflow"."userId" AS "SharedWorkflow_userId", "SharedWorkflow__SharedWorkflow_workflow"."createdAt" AS "SharedWorkflow__SharedWorkflow_workflow_createdAt", "SharedWorkflow__SharedWorkflow_workflow"."updatedAt" AS "SharedWorkflow__SharedWorkflow_workflow_updatedAt", "SharedWorkflow__SharedWorkflow_workflow"."id" AS "SharedWorkflow__SharedWorkflow_workflow_id", "SharedWorkflow__SharedWorkflow_workflow"."name" AS "SharedWorkflow__SharedWorkflow_workflow_name", "SharedWorkflow__SharedWorkflow_workflow"."active" AS "SharedWorkflow__SharedWorkflow_workflow_active", "SharedWorkflow__SharedWorkflow_workflow"."nodes" AS "SharedWorkflow__SharedWorkflow_workflow_nodes", "SharedWorkflow__SharedWorkflow_workflow"."connections" AS "SharedWorkflow__SharedWorkflow_workflow_connections", "SharedWorkflow__SharedWorkflow_workflow"."settings" AS "SharedWorkflow__SharedWorkflow_workflow_settings", "SharedWorkflow__SharedWorkflow_workflow"."staticData" AS "SharedWorkflow__SharedWorkflow_workflow_staticData", "SharedWorkflow__SharedWorkflow_workflow"."pinData" AS "SharedWorkflow__SharedWorkflow_workflow_pinData", "SharedWorkflow__SharedWorkflow_workflow"."versionId" AS "SharedWorkflow__SharedWorkflow_workflow_versionId", "SharedWorkflow__SharedWorkflow_workflow"."triggerCount" AS "SharedWorkflow__SharedWorkflow_workflow_triggerCount", "SharedWorkflow__SharedWorkflow_role"."createdAt" AS "SharedWorkflow__SharedWorkflow_role_createdAt", "SharedWorkflow__SharedWorkflow_role"."updatedAt" AS "SharedWorkflow__SharedWorkflow_role_updatedAt", "SharedWorkflow__SharedWorkflow_role"."id" AS "SharedWorkflow__SharedWorkflow_role_id", "SharedWorkflow__SharedWorkflow_role"."name" AS "SharedWorkflow__SharedWorkflow_role_name", "SharedWorkflow__SharedWorkflow_role"."scope" AS "SharedWorkflow__SharedWorkflow_role_scope" FROM "n8n2"."shared_workflow" "SharedWorkflow" LEFT JOIN "n8n2"."workflow_entity" "SharedWorkflow__SharedWorkflow_workflow" ON "SharedWorkflow__SharedWorkflow_workflow"."id"="SharedWorkflow"."workflowId" LEFT JOIN "n8n2"."role" "SharedWorkflow__SharedWorkflow_role" ON "SharedWorkflow__SharedWorkflow_role"."id"="SharedWorkflow"."roleId"
DEFAULT 2023-04-19T20:16:34.859498068Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1180
DEFAULT 2023-04-19T20:16:35.012477455Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "SharedWorkflow"."workflowId" AS "SharedWorkflow_workflowId", "SharedWorkflow"."userId" AS "SharedWorkflow_userId", "SharedWorkflow__SharedWorkflow_workflow"."createdAt" AS "SharedWorkflow__SharedWorkflow_workflow_createdAt", "SharedWorkflow__SharedWorkflow_workflow"."updatedAt" AS "SharedWorkflow__SharedWorkflow_workflow_updatedAt", "SharedWorkflow__SharedWorkflow_workflow"."id" AS "SharedWorkflow__SharedWorkflow_workflow_id", "SharedWorkflow__SharedWorkflow_workflow"."name" AS "SharedWorkflow__SharedWorkflow_workflow_name", "SharedWorkflow__SharedWorkflow_workflow"."active" AS "SharedWorkflow__SharedWorkflow_workflow_active", "SharedWorkflow__SharedWorkflow_workflow"."nodes" AS "SharedWorkflow__SharedWorkflow_workflow_nodes", "SharedWorkflow__SharedWorkflow_workflow"."connections" AS "SharedWorkflow__SharedWorkflow_workflow_connections", "SharedWorkflow__SharedWorkflow_workflow"."settings" AS "SharedWorkflow__SharedWorkflow_workflow_settings", "SharedWorkflow__SharedWorkflow_workflow"."staticData" AS "SharedWorkflow__SharedWorkflow_workflow_staticData", "SharedWorkflow__SharedWorkflow_workflow"."pinData" AS "SharedWorkflow__SharedWorkflow_workflow_pinData", "SharedWorkflow__SharedWorkflow_workflow"."versionId" AS "SharedWorkflow__SharedWorkflow_workflow_versionId", "SharedWorkflow__SharedWorkflow_workflow"."triggerCount" AS "SharedWorkflow__SharedWorkflow_workflow_triggerCount", "SharedWorkflow__SharedWorkflow_role"."createdAt" AS "SharedWorkflow__SharedWorkflow_role_createdAt", "SharedWorkflow__SharedWorkflow_role"."updatedAt" AS "SharedWorkflow__SharedWorkflow_role_updatedAt", "SharedWorkflow__SharedWorkflow_role"."id" AS "SharedWorkflow__SharedWorkflow_role_id", "SharedWorkflow__SharedWorkflow_role"."name" AS "SharedWorkflow__SharedWorkflow_role_name", "SharedWorkflow__SharedWorkflow_role"."scope" AS "SharedWorkflow__SharedWorkflow_role_scope" FROM "n8n2"."shared_workflow" "SharedWorkflow" LEFT JOIN "n8n2"."workflow_entity" "SharedWorkflow__SharedWorkflow_workflow" ON "SharedWorkflow__SharedWorkflow_workflow"."id"="SharedWorkflow"."workflowId" LEFT JOIN "n8n2"."role" "SharedWorkflow__SharedWorkflow_role" ON "SharedWorkflow__SharedWorkflow_role"."id"="SharedWorkflow"."roleId"
DEFAULT 2023-04-19T20:16:35.030470419Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1327
DEFAULT 2023-04-19T20:16:35.483835412Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] allWorkOrders { json: { records: [] }, pairedItem: { item: 0, input: undefined } }
DEFAULT 2023-04-19T20:16:35.494819237Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] []
DEFAULT 2023-04-19T20:16:44.983636497Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "User"."createdAt" AS "User_createdAt", "User"."updatedAt" AS "User_updatedAt", "User"."id" AS "User_id", "User"."email" AS "User_email", "User"."firstName" AS "User_firstName", "User"."lastName" AS "User_lastName", "User"."password" AS "User_password", "User"."resetPasswordToken" AS "User_resetPasswordToken", "User"."resetPasswordTokenExpiration" AS "User_resetPasswordTokenExpiration", "User"."personalizationAnswers" AS "User_personalizationAnswers", "User"."settings" AS "User_settings", "User"."globalRoleId" AS "User_globalRoleId", "User"."disabled" AS "User_disabled", "User"."apiKey" AS "User_apiKey", "User__User_globalRole"."createdAt" AS "User__User_globalRole_createdAt", "User__User_globalRole"."updatedAt" AS "User__User_globalRole_updatedAt", "User__User_globalRole"."id" AS "User__User_globalRole_id", "User__User_globalRole"."name" AS "User__User_globalRole_name", "User__User_globalRole"."scope" AS "User__User_globalRole_scope" FROM "n8n2"."user" "User" LEFT JOIN "n8n2"."role" "User__User_globalRole" ON "User__User_globalRole"."id"="User"."globalRoleId" WHERE ( ("User"."id" = $1) ) AND ( "User"."id" IN ($2) ) -- PARAMETERS: ["9c7abeda-4230-4ce3-ba51-c903a32f2fce","9c7abeda-4230-4ce3-ba51-c903a32f2fce"]
DEFAULT 2023-04-19T20:16:44.994493594Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1521
DEFAULT 2023-04-19T20:16:49.277532139Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] query is slow: SELECT "ExecutionEntity"."id" AS "ExecutionEntity_id", "ExecutionEntity"."data" AS "ExecutionEntity_data", "ExecutionEntity"."finished" AS "ExecutionEntity_finished", "ExecutionEntity"."mode" AS "ExecutionEntity_mode", "ExecutionEntity"."retryOf" AS "ExecutionEntity_retryOf", "ExecutionEntity"."retrySuccessId" AS "ExecutionEntity_retrySuccessId", "ExecutionEntity"."status" AS "ExecutionEntity_status", "ExecutionEntity"."startedAt" AS "ExecutionEntity_startedAt", "ExecutionEntity"."stoppedAt" AS "ExecutionEntity_stoppedAt", "ExecutionEntity"."workflowData" AS "ExecutionEntity_workflowData", "ExecutionEntity"."workflowId" AS "ExecutionEntity_workflowId", "ExecutionEntity"."waitTill" AS "ExecutionEntity_waitTill" FROM "n8n2"."execution_entity" "ExecutionEntity" WHERE ("ExecutionEntity"."id" = $1) LIMIT 1 -- PARAMETERS: [55792]
DEFAULT 2023-04-19T20:16:49.282455032Z [resource.labels.instanceId: docker-compose-n8n-vm-vm] execution time: 1413
There is a series of slow queries and my theory is that these build up memory usage, do you know why could this be the case?