[Self-hosted] High CPU usage

Describe the problem/error/question

Selfhosted n8n installation on an Amazon AWS Lighstail instance with 2vCPUs, 8GB RAM, 160GB SSD

I have only one workflow active with very little executions, I am still in the “testing phase” of figuring out what to do with n8n. At this point, there is only a simple chatbot workflow passing user messages to chatGPT and responding with a reply, no file transfer, no executions for the past 1 week.

Since about 2 days ago I can see massive 40% CPU usage from n8n, referring to the below item in htop

node --disallow-code-generation-from-strings --disable-proto=delete /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+task-runner...

I did make some changes to my firewall recently where I migrated my nameservers to Cloudlfare, but that should not have impacted my n8n installation. What am I missing here that causes this much CPU usage?

Information on your n8n setup

  • n8n version: 1.99.1 (will update soon)
  • Database (default: SQLite): MySQL
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04 LTS

Hey @patrickmau

You can find doc on task runner here Task runners | n8n Docs I did a quick look didn’t see anything on CPU spikes, but latest version may have fixed it already always worth testing.

Are you using code nodes? Also do you see any memory spikes or just CPU?

And exactly I doubt changing name server caused it I use cloudflare also.
Samuel

Thank you @King_Samuel_David , appreciate the link.

I updated to the latest version and still see some spikes on and off, but seems a bit more efficient right now. Will monitor for a while.

I do however see some web socket issues in the console log that seem Cloudflate related, curious if I you managed to resolve those? I am unable to open specific ports in Cloudflare as this is limited to the Enterprise edition, so not entirely sure if this is related to my issue.

I used cloudflare tunnel with it cf dns, what sort of erros u seeing in console? @patrickmau

Samuel