-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Usage on Cloudflare Worker #2
Comments
execution time is an issue too, you would easily hit the 50 millisecond CPU execution time limit (Workers Bundled plan, free-tier is 10ms) for trivial tasks/operations. judging by the Speed and memory use from libvips' Wiki, memory consumption is not an issue for using libvips in Workers unlike alternative/competing libraries (33MB is under the 128MB memory limit), however 520ms/(50ms+) CPU execution time is (if you can't use Workers Unbound): |
Workers unbound is still pretty cheap so no problem with that. I think it has a lot of potential. |
I still need to investigate whether this project can be supported on Cloudflare Workers, but note that this is being done on best effort. Line 72 in 71ee394
Line 80 in 71ee394
And to disable unnecessary loaders/savers via libvips' configure flags: Lines 313 to 315 in 71ee394
That said, it seems that Cloudflare maintains a "no background threads" policy because of the potential for Spectre attacks, which could cause problems with wasm-vips as it requires the SharedArrayBuffer API to be available (for V8, an additional argument, |
Please sign up to Larger script sizes for CFW here: https://www.cloudflare.com/larger-scripts-on-workers-early-access/ |
wasm-vips in its current form can never run on Cloudflare workers (unfortunately), see the explanation at: https://github.com/kleisauke/cf-worker-wasm-vips#readme Hopefully this will no longer be an issue when WebAssembly standardizes its https://github.com/WebAssembly/shared-everything-threads proposal. Or alternatively, when Cloudflare workers supports the Web Workers API, allowing WebAssembly memory to be shared between workers (via |
Hey, is there any update on this issue? |
@sixers No updates, comment #2 (comment) is still relevant at the time of writing (and I do not expect a resolution soon). Issue #18 might also be relevant here. |
Cloudflare has updated its documentation to mention that neither threading nor the Web Workers API is supported: Given that libvips requires threading functionality to be available, I'll close this as "won't fix" for now. |
Hello,
This is a cool project, and I was thinking of using it in Cloudflare Workers and saw your card here https://github.com/kleisauke/wasm-vips/projects/1#card-44661973
There's a hurdle, however, that prevents this from being possible: "The module and script together must be under 1MB after gzip compression" - https://community.cloudflare.com/t/what-is-the-maximum-allowed-size-of-a-webassembly-module/66453/2
The .wasm file is ~4.3 MB uncompressed, and ~1.41MB (gzip 9) compressed. Maybe a slimmed version of the library could still be used, with some support for formats dropped?
The text was updated successfully, but these errors were encountered: