Reading starts here
ChurnAtlas

Vercel function limits: 6 checks before a webhook

Short answer. Check six Vercel function limits before shipping a customer success webhook, covering bundle size, Edge response timing and shared file descriptors.

ChurnAtlas Editorial Team. How posts are made is set out in the editorial standards.

Published · Sources checked · 9 min read

  1. Inputs Your product plan, your permissions and the task you want to finish.
  2. Decision Whether the help page matches what you see on your screen.
  3. Next action Do the task on one test account, then record what you changed.

Vercel Functions have limits on bundle size, large function support, Edge response timing, streaming duration and shared file descriptors; check them before shipping a webhook.

Key takeaways

  • Record the endpoint's language and runtime.
  • Measure the unpacked bundle after a clean build.
  • Check large function support with the project owner.
  • Test response timing and simultaneous requests before shipping.

It might be a webhook that receives events from your helpdesk or CRM, or a health score endpoint that recalculates an account's score and sends the result onward. Either way, if that code runs on Vercel Functions, it has limits you need to know about before it goes live.

This post covers six limits from the Vercel docs. Each section gives the number the way the docs state it, links to the page it comes from, and explains what the number means for a small endpoint. Where a limit applies only to one runtime or one language, the section says so. This post does not cover every limit Vercel documents, so read the full page before you ship.

You do not need to write the code to run this check. You do need four facts about your endpoint:

  • The language it is written in.
  • The runtime it runs on.
  • How large the code is after a local build.
  • What it opens while it handles one request, such as outbound calls, database connections, or files.

Write these four answers down in one place. Whoever set up the project can help you find them, and the rest of the post will be easier to follow once you have them.

1. What is the uncompressed size limit for Vercel Functions?

For Vercel Functions, the maximum uncompressed size is 250 MB, including layers. The Vercel Functions Limits page also notes that layers are used automatically depending on the runtime, and that they are included in that figure.

Pay attention to the word "uncompressed." The limit is about the size of the code once it is unpacked, so judge your bundle by its unpacked size, not by how small a zipped copy looks.

To check it yourself, run a build on your own machine and measure the folder that holds the code the function will deploy. Keep a clear margin below the limit rather than planning to land just under it, since a rough local measurement can miss something.

Consider how these endpoints grow. A health score endpoint might start as a few hundred lines that read account data and write a score. Over time, someone adds a date library for renewal logic, a spreadsheet library for an export, and a client for the CRM. Each addition makes sense on its own. The limit only sees the total.

Here is a simple way to run the check. Ask the engineer to build the project from a clean copy of the code, not from a machine with leftover files from earlier tests. Record the size of the folder, the date, and the version of the code it came from. Then repeat the check after any change that adds a package, so the number in your note stays current. A note with a date is much easier to trust than a number someone remembers.

Illustrative example: a bundle size check

Suppose a clean build produces an illustrative unpacked bundle of 300 MB. That exceeds the general size limit above. Ask the engineer which packages the deployed function needs, remove unnecessary ones, and measure again before deciding whether large function support is appropriate.

2. What is the size limit for Python functions?

For Python functions, the maximum uncompressed size is 500 MB ( Vercel Functions Limits).

That figure is separate from the general number in the previous section, which the same page gives for Vercel Functions. If your endpoint is written in Python, read the linked page for how the two figures apply to your code, and do not assume that one replaces the other.

Whatever the language, the same habit helps. List every package your endpoint imports. Remove anything you added for a one-time job, such as a report script or a test helper, if the deployed function does not need it at runtime. Ask your engineer to walk through the list with you, and to say which packages the deployed function actually needs.

Python also raises its own questions. Which Python version does the endpoint use, and do any of the imported packages exist only for testing or for scripts run by hand? Use the answers to document the environment and identify unnecessary packages. If the answers are unclear, do not guess. Ask for the list in writing.

3. How large can a large function be?

Large functions let you deploy uncompressed bundles up to 5 GB ( Vercel Functions Limits). That is a much higher ceiling than the general figure, so it matters if your code has grown past that point.

The same page describes a setting that controls this. Set it to 1 to enable support for large functions, or to 0 to disable it, for both new and existing projects. Read the linked page for the name of the setting, and check its current value before you plan a deploy. Since it affects existing projects too, do not change it without talking to the person who owns the project.

Treat this as a decision, not a quick fix. If your bundle is near the general figure, the first question is whether you can make the bundle smaller.

If your team does change the setting, write down what you changed, who approved it, and the date. Include the value you set and the value it had before. Someone looking at another project later may need to know why a value changed. Keep the note with the endpoint's other records.

4. How long can an Edge runtime function keep streaming?

An Edge runtime function must begin sending a response within 25 seconds to maintain streaming, and it can continue streaming for up to 300 seconds ( Vercel Functions Limits).

The two numbers do different jobs: one sets the response deadline; the other caps streaming duration.

This line is about Vercel Functions that use the Edge runtime. Before you apply it, confirm which runtime your endpoint uses. If it uses a different runtime, do not apply these numbers to it. Look at the linked page for the limits that cover that runtime instead.

For a webhook, the practical question is the order of work. If your handler does slow work before it sends anything back, time that work and decide whether the response can go out sooner. Check what the system that sends events to you expects, and plan around that instead of guessing. Use the guide to billing webhook replies and retries when reviewing the sending system.

Here is a concrete example. Suppose a helpdesk sends an event to your endpoint, and your handler first looks up the account, recalculates a score, writes the result to a dashboard, and only then replies. Each step takes time. Acknowledging the event first and doing the rest afterward may be worth considering. Whether that design fits depends on your runtime and on what the sending system expects, so test it on the runtime you will actually use.

5. How many file descriptors can Vercel functions use?

Vercel Functions have a limit of 1,024 file descriptors shared across all concurrent executions ( Vercel Functions Limits).

The word "shared" is the important part. Requests that run at the same time draw from the same pool, so checking a single request on its own is not enough. A test that passes with one event at a time tells you little about what happens when several events arrive together.

Make a list of what your code opens during one request. Outbound HTTP calls, database clients, and file reads all belong on the list. Then check two things: that each one is closed when the work is done, and that your code does not open a new client for every event when one client could be reused.

A health score job that loops over many accounts and opens a connection for each one is a good example of how this pool can fill up. Bring the list to your engineer and ask which items can be reused or closed sooner.

When you review the list, look for anything your code opens and does not close on purpose. Ask how long each connection stays open. Test a request that fails on purpose, and confirm that your cleanup still runs, since a failure path is easy to overlook when a test only covers the happy path.

6. Does the runtime count toward the file descriptor limit?

Yes, the shared limit includes file descriptors used by the runtime itself. The Vercel Functions Limits page says the actual number available to your application code will be strictly less than 1,024.

Leave headroom, and test under the traffic the endpoint will actually receive.

If you are unsure what your traffic will look like, ask the team that owns the source system. They can tell you how many events may arrive together, and you can compare that number to your test results before the webhook goes live. Ask them, too, whether the sending system ever retries an event, since retries can add to the number of events that arrive at once. For that review, see webhook retry clocks.

A simple test plan can be done in an afternoon. Send a small burst of test events to a test deployment that is not your live endpoint, and record whether every one gets a clean response. Then repeat the burst with a larger number of events. If the results look different from your local tests, trust the deployed test and ask the engineer to explain the gap.

Write the tested burst size and any unresolved failures in the note so the next reviewer can repeat the test.

A limit is a boundary, not a target. Your job is to know where the endpoint sits relative to each figure today, and to decide in advance what you will do if it moves closer. That decision is easier to make on a quiet afternoon than in the middle of a problem.

If a check shows that your bundle is larger than the figure that applies to it, the linked page is the next place to look. Do not guess your way past a limit.

Keep the results in a short note next to the endpoint, with the date and the names of the people who reviewed it. The next person who changes the code will then know what was checked and what still needs attention.

Today, ask the project owner for the latest clean-build size and test results, then record any missing checks in that note.

What should you check before the webhook ships?

Which endpoint should you review?

Review the exact endpoint you plan to deploy. Use its current code and settings rather than an earlier local version.

What if you cannot identify the runtime?

Ask whoever set up the project to confirm it before choosing the applicable limits. Keep the answer with the endpoint's other records.

What should you do with an unresolved check?

Record the open question and ask the project owner to resolve it before shipping. These checks do not require a deep engineering background. Spend an hour with the endpoint, the linked docs, and the person who owns the project, then decide together whether it goes live.

Sources

Sources checked

Limits of this post

This post is general operational information, not legal advice about notice periods or renewal clauses. It does not promise that any method keeps a customer. Software can get a fact wrong, so open the sources before you act.