Would it be possible to use AWS Lambda to run unsafe user scripts? It should be:
- should have memory limit (seems like AWS Lambda has it).
- should have execution timeout (seems like AWS Lambda also has it). Additionally it should be impossible to setup something like
setInterval(consumeLittleCpu, 500). - (would be nice to have) different scripts should be isolated.
Would it be efficient? Like for example you have let's say 5000 different scripts and every one of it get executed once for every 1-30 sec?
How much more would it cost compared to do the same using usual AWS instance? Order of magnitude precision would be fine, like saying "it will cost you no more than 10x same on usual AWS instance" would be good enough.