Skip to content

Concurrency is set to 80 by default #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andreas-thomik opened this issue May 3, 2024 · 1 comment
Closed

Concurrency is set to 80 by default #202

andreas-thomik opened this issue May 3, 2024 · 1 comment

Comments

@andreas-thomik
Copy link

Description

According to the documentation, a default function has a memory of 256MB (which translates to .167 vCPU according to this).

    memory: int | MemoryOption | Expression[int] | _util.Sentinel | None = None
    """
    Amount of memory to allocate to a function.
    A value of ``RESET_VALUE`` restores the defaults of 256MB.
    """
 
    ...

    concurrency: int | Expression[int] | _util.Sentinel | None = None
    """
    Number of requests a function can serve at once.
    Can be applied only to functions running on Cloud Functions (2nd gen).
    A value of ``RESET_VALUE`` restores the default concurrency (80 when CPU >= 1, 1 otherwise).
    Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
    The maximum value for concurrency is 1,000.
    """

However, when creating a function with a default setup like that

from firebase_functions import https_fn

@https_fn.on_call()
def test_func():
    return None

We end up with a concurrency of 80:
image

@exaby73
Copy link
Contributor

exaby73 commented May 6, 2024

Hello @andreas-thomik. This is working as intended. If you see the cpu parameter, it defaults to 1, which makes the concurrency default to 1 as well:

    cpu: int | _typing.Literal["gcf_gen1"] | _util.Sentinel | None = None
    """
    Fractional number of CPUs to allocate to a function.
    Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
    This is different from the defaults when using the gcloud utility and is different from
    the fixed amount assigned in Cloud Functions (1st gen).
    To revert to the CPU amounts used in gcloud or in Cloud Functions (1st gen), set this
    to the value "gcf_gen1"
    """

Since this is working as intended, I will close this issue. Thank you

@exaby73 exaby73 closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants