Skip to content

Script size limits are too strict for Python apps #156

Description

@whitphx

The current size limits of 3MB (free plan) or 10MB (paid plan) for the gzipped size are too tight for Python apps because many popular Python libraries contain large binaries.
For example, when I tried to deploy an app using the following libraries, it easily hit the limit (sizes are the sums of the gzipped files of each vendored package):

  • pandas 2.3.3: 4.22MB
  • numpy 2.2.5: 2.90MB
  • Pillow 11.3.0 (PIL): 0.99MB
  • altair 6.0.0: 0.74MB
  • libcrypto.so: 0.62MB

All of them were vendored from the Pyodide v0.29.3 distribution (Python 3.13), synced with workers-py 1.15.0 and deployed with wrangler 4.110.0.

I believe these libraries are very commonly used in the Python ecosystem and cannot be omitted when developing meaningful applications in certain domains.

I believe this is one of the biggest differences from the JavaScript ecosystem.

It would be great if

  • the size limit were relaxed for Python Workers,
  • such prepackaged/common libraries were excluded from the size calculation,
  • or some other solution were provided.

Thank you.

Activity

  1. ryanking13 commented on Jul 24, 2026

    @ryanking13
    Contributor

    Thanks for the suggestion (fyi for other readers, we've been discussing this in EuroPython offline).

    The current size limits of 3MB (free plan) or 10MB (paid plan) for the gzipped size are too tight for Python apps because many popular Python libraries contain large binaries.

    We are planning to change this to 64 MB, uncompressed size for every plan. I thought it was already applied, but it seems like it isn't yet.

    such prepackaged/common libraries were excluded from the size calculation,

    Unfortunately, this is unlikely to happen. Instead, I am thinking to implement some kind of Python bundler, similar to the JS bundlers that compresses Python libraries and do the tree-shaking.

  2. whitphx commented on Jul 28, 2026

    @whitphx
    ContributorAuthor

    Thank you,

    • I will be waiting for the size limit change to be rolled out.
    • Python bundler sounds cool.
      • but in my case the dominant large files were compiled binaries in native packages such as numpy and pandas.
  3. ryanking13 commented on Jul 28, 2026

    @ryanking13
    Contributor

    Yeah, unfortunately if you are running a cpu heavy workload with large packages, it doesn't perfectly fit with the design of the Cloudflare workers, and probably you need to combine other products such as Cloudflare containers.

  4. ryanking13 commented on Sep 7, 2026

    @ryanking13
    Contributor

    We are planning to change this to 64 MB, uncompressed size for every plan. I thought it was already applied, but it seems like it isn't yet.

    FYI, this is released (cloudflare/cloudflare-docs#33241)

  5. whitphx commented on Sep 7, 2026

    @whitphx
    ContributorAuthor

    Good to know that. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions