Normally, if you get a Root Server in the cloud, you can
also install arbitrary binaries. You get anyway a virtualized
operating system with some limited CPU and memory.
That Cloud Flare has a variant of Servers in the cloud,
that promote nodejs is a kind of bandwagon, but why should
you jump on this bandwagon? One reason is that nodejs
works lock free, and the corresponding webserver doesn’t
require multi-threading. So you would possibly squeeze
a single threaded version of SWI-Prolog into the 1 MB
to profit from this model of execution. You can then scale
in ordering more CPUs and starting more workers (sic!).
Edit 03.10.2022
Disclaimer: I didn’t do this things yet, just reading the brochures:
https://developers.cloudflare.com/workers/learning/how-workers-works/
Isolates are resilient and continuously available for the duration of a request.
But I guess you could offer the same with a single threaded SWI-Prolog
on binary platforms, and changing the SWI-Prolog HTTP server, into
something that works with an event queue. (Maybe its even multi-threaded
SWI-Prolog ?), but for the end-user it would look single threaded, and it should
also feel single threaded, i.e. have the performance of single threaded, so
many of with_mutex/2 would not be needed,
also the Prolog dynamic database could use more efficient data structures,
than the current lock free concurrent data structures. Although their overhead
seems to be small. But anything that accounts for multi-threading
can be thrown over board, you can shed ballast.