Lack of immediate access to I/O ramp-up and global replication Physical maintenance of the device - power/network/physical management/etc Time and energy spent maintaining/configuring the device However, there are a lot of other factors to consider: You get a full computer with much more I/O. Lastly, Go programs are more likely to be "lazy"-that is, they only run the things they need in the main() part of the program whereas Python packages are much more likely to do file or network I/O to initialize clients that may or may not be used by the program.Īnd it costs even more if you need that Lambda function to have access to the internet.Ī Raspberry Pi 3 (~6.5 watts) costs $6.83 per year to run full-time (at 12 cents per kWh). My rule of thumb (based on some profiling) is that for every 30mb of Python dependency, the equivalent Go binary grows by 1mb, moreover, it all gets loaded at once (as opposed to resolving each unique import to a location on disk, then parsing, compiling, and finally loading it). (at least for JavaScript) just 35mb of dependencies (which will buy you half of a numpy iirc) causes cold start performance to go from ~250ms to 4000ms. Latency probably matters to them, but they still have to import things to get their work done. Maybe someone is transforming a bit of audio as part of a pipeline or doing some analysis on a CSV or something else. Not every lambda is just slinging API requests-some of them actually have to do things with data. > Python cold booting an interpreter 3 seconds faster than Go is a big deal, especially if your target execution time is not being silly and importing ridiculously heavy dependencies into a lambda for no reason other than to make a strange point about Python being unsuitable for something nobody should be doing. Go doesn't have all of the specialty libraries that Python has, but it has enough for the use case I described above. > And good luck getting such libraries in go. Anyway, don't get hung up on data science it was just an example, but there are packages across the ecosystem that behave poorly at startup (usually it's not any individual package taking 1-2s but rather a whole bunch of them scattered across your dependency tree that take 100+ms). Nonsense, there are a lot of lambdas that just load, transform, and shovel data between services using pandas or whathaveyou. > Using data science tooling in a lambda seems iffy, especially ones that are not production ready. So the unlucky request that triggers a cold start eats that cold start. It's not the occasional 5-second long request, it's "the app doesn't start serving requests for 5 seconds".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |