Exceeding 512 MB memory with one very simple AI node

Describe the problem/error/question

I am just starting with n8n, and have set up on a server on Render.com. It has 512MB of memory. This seemed to be fine, until I tried a very simple AI node to which I connected ChatGPT. Then I asked a simple query (why is the sky blue), and the server crashed when it hit maximum memory. Seems unlikely that’s supposed to happen.

What is the error message (if any)?

No error message in n8n. Message in Render that the server exceeded memory and n8n starts to give 502 errors.

Please share your workflow

<{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "b0e51ffc-1723-4484-8a80-f8db74716794",
      "name": "When clicking ‘Test workflow’"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1367ce16-5c31-4e13-a404-1eba913f56af",
              "name": "blog_post_inputs",
              "value": "[[BUSINESS INFO START]]|[[BUSINESS NAME]]:Brett's Books|[[BUSINESS BASIC INFORMATION]]:Brett's Books, Main St Wellington. Sell second hand books, rare books. A specialist shop dealing with rarities and top quality publications. Entirely non-fiction. No fiction allowed. Note we do not hold events so please don't mention them. |[[STORY BEHIND THEIR BUSINESS]]:Loved books since I was a kid. Grandad had a book store too. Just followed in his footsteps.|[[WHAT MAKES THEM UNIQUE IN THE COMMUNITY]]:Only store in NZ that sells non-fiction and refuses to sell fiction|[[THEIR MOST POPULAR PRODUCTS OR SERVICES]]:19th Century research papers|[[WHAT CUSTOMERS LOVE ABOUT THEM]]:The smell. There's something about the smell of old books|[[WHAT THEY WANT POTENTIAL CUSTOMERS TO KNOW]]:come visit... and just know that if you can manage to sneak the word sausage into the conversation you'll get a big discount. Just a running joke. |[[PREFERRED CTA]]:Phone|[[ADDRESS]]:123 Main St|[[CITY]]:Wellington|[[PHONE]]:4784566|[[EMAIL]:[email protected]|[[WEBSITE]]:brettsbooks.com|[[BUSINESS INFO END]]",
              "type": "string"
            },
            {
              "id": "05ca227c-f13c-4237-8004-1099babdf979",
              "name": "blog_post",
              "value": "=**Uncover the Charm of Brett's Books**\n\nImagine stepping into a world where every book tells a story of its own, not just through its content, but through its history. Brett's Books, located on Main Street, Wellington, is a haven for book lovers who crave the unique allure of non-fiction. The moment you walk in, the scent of aged paper and leather-bound tomes wraps around you like a comforting embrace. It's not just a bookstore; it's a journey through time, where each book has its own tale to tell.\n\nWhat sets Brett's Books apart is its commitment to non-fiction. While the world of fiction is vast and popular, Brett's Books stands firm in its dedication to reality-based literature. This makes it the only store in New Zealand with such a niche focus. For those who revel in the truth, this is your paradise. It's a place where curiosity is nurtured, and knowledge is celebrated.\n\nThe story of Brett's Books is as charming as the store itself. Brett, the owner, has been a book enthusiast since childhood. His grandfather owned a bookstore, and Brett spent countless hours there, developing a deep love for the written word. Following in his grandfather's footsteps, Brett opened his own store, driven by a passion for non-fiction and a desire to share it with the world.\n\nBrett's dedication to non-fiction is not just a business strategy; it's a personal journey. He believes in the power of real stories and facts to educate and inspire. This passion is evident in every corner of the store, from the carefully curated selection of books to the knowledgeable staff who share Brett's enthusiasm for non-fiction.\n\nBrett's Books is more than just a bookstore; it's a beloved part of the Wellington community. The shop has become a gathering place for like-minded individuals who appreciate the beauty of non-fiction. It's a space where people can come together, share ideas, and learn from one another. Brett's commitment to his community is evident in the warm, welcoming atmosphere he has created.\n\nWhat makes Brett's Books truly special is its exclusivity. As the only store in New Zealand that sells only non-fiction, it has carved out a unique niche in the market. This dedication to a specific genre has earned Brett's Books a loyal following of customers who appreciate the store's unique offerings and commitment to quality.\n\nOne of the standout features of Brett's Books is its collection of 19th-century research papers. These rare publications are a treasure trove for historians and enthusiasts alike. Customers often rave about the thrill of finding a rare gem among the shelves. And, of course, there's that unmistakable scent of old books that fills the air, a sensory delight that book lovers can't resist.\n\nVisitors to Brett's Books are often captivated by the store's charm and the quality of its collection. Whether you're a seasoned collector or a curious newcomer, Brett's Books offers something for everyone. The knowledgeable staff are always on hand to help you find exactly what you're looking for, making each visit a memorable experience.\n\nIf you're intrigued by the allure of Brett's Books, why not pay a visit and experience it for yourself? And here's a little insider tip: if you manage to sneak the word \"sausage\" into your conversation with Brett or his staff, you'll be in for a delightful surprise—a big discount! It's all part of a running joke that adds a touch of fun to your shopping experience.\n\nTo learn more or to plan your visit, give Brett's Books a call at 4784566. Whether you're a local or just passing through Wellington, a trip to Brett's Books promises an experience unlike any other. Discover the world of non-fiction and let your curiosity lead the way in this charming, one-of-a-kind bookstore.",
              "type": "string"
            },
            {
              "id": "2e14d9b1-85ec-413b-bd11-9b60f236e6de",
              "name": "video_script",
              "value": "[[BUSINESS INFO START]]|[[BUSINESS NAME]]:Brett's Books|[[BUSINESS BASIC INFORMATION]]:Brett's Books, Main St Wellington. Sell second hand books, rare books. A specialist shop dealing with rarities and top quality publications. Entirely non-fiction. No fiction allowed. Note we do not hold events so please don't mention them. |[[THEIR MOST POPULAR PRODUCTS OR SERVICES]]:19th Century research papers|[[WHAT CUSTOMERS LOVE ABOUT THEM]]:The smell. There's something about the smell of old books|[[WHAT THEY WANT POTENTIAL CUSTOMERS TO KNOW]]:come visit... and just know that if you can manage to sneak the word sausage into the conversation you'll get a big discount. Just a running joke. |[[PREFERRED CTA]]:Phone|[[ADDRESS]]:123 Main St|[[CITY]]:Wellington|[[PHONE]]:4784566|[[EMAIL]:[email protected]|[[WEBSITE]]:brettsbooks.com|[[BUSINESS INFO END]]",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "id": "6d3216d9-3b43-4f90-8658-7f270d9d8f4f",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "give me the fibonacci numbers up to 100"
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        440,
        0
      ],
      "id": "4d77776a-0f14-4baa-aeb9-36822fedbab5",
      "name": "Basic LLM Chain",
      "disabled": true
    },
    {
      "parameters": {
        "model": "anthropic/claude-3.5-sonnet",
        "options": {
          "frequencyPenalty": 0
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        460,
        240
      ],
      "id": "0b073c97-5e8f-4ed9-817b-7a93883050dd",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "id": "dWRVsetxMbzdjcEJ",
          "name": "OpenRouter NSG"
        }
      }
    }
  ],
  "connections": {
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        []
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "b675add40c486cd2520f87bf4fd5508f9f761ac2171842957fa0c63d8f12850b"
  }
}/>

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
    1.81.0

  • Database (default: SQLite):
    postgres database on supabase

  • n8n EXECUTIONS_PROCESS setting (default: own, main):
    I don’t know how to find this. But based on reading I think it’s “own”

  • Running n8n via (Docker, npm, n8n cloud, desktop app):
    On Render.com using npm / Node v 22

  • Operating system:
    Linux I presume.

You could try to improve memory usage by splitting your workflow into subworkflows. Or lowering the amount of data it processes.

But 512MB is really the bare minimum. It won’t run very well.

You may need to upgrade to at least 1GB.

2 Likes

If my reply answers your question, please remember to mark it as a solution.

Thank you. I did end up upgrading to 2GB.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.