Serverless environment
andrewluetgers opened this issue · 1 comments
Are there any suggestions on how to handle usage under something like AWS Lambda. I am assuming the best course is to create and destroy a connection on every request as you otherwise may create many orphaned connections. Would you agree? Is there significant overhead to doing it this way?
Hello there! I'm unfortunately not familiar w/ AWS Lambda and FaaS environments, though I'd see no issue in opening up many connections and closing them, as long as you receive a SIGTERM on your Lambda and that you issue a clean library disconnect/close command; then the underlying TCP channel will be closed and Sonic will be fine; ref: https://github.com/valeriansaliou/node-sonic-channel#3-teardown-connection
Regarding overhead, Sonic doesn't do much work to handle each new connection, so that's fine on that.