Hello,
I am trying to increase the memory of one of our Background Function, as documented here: Configuration for functions | Netlify Docs
I tried adding it in the netlify.toml
[functions.my-function-name-background]
memory = "2gb"
But as it didn’t have any effect I added it to the Config entry in our function netlify/functions/my-function-name-background.ts
import type { Config } from "@netlify/functions";
...
export const config = {
method: "POST",
background: true,
memory: "2gb",
} satisfies Config & { background: true; memory: "2gb" };
...
export const myFunctionNameBackground = async (
req: Request,
): Promise<Response> => {
I tried logging the memory with this
console.info(
`[Runtime] [${instanceId}] Lambda memory limit: ${process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE ?? "unknown"} MB`,
);
and it does output
INFO [Runtime] [b81ce61c] Lambda memory limit: 1024 MB
Finally, we still see our functions reaching 1024MB, and not 2GB
Duration: 171082 ms Memory Usage: 1024 MB
We are correctly on the credit based Pro plan.
Is there anything wrong in my setup? Is this setting not supported for background functions?
Thank you!