News for hackers. Stuff that matters.
Re:How We Designed for Performance and Scale by nodesocket on Wednesday June 10, 2015 @02:18PM (#9694233)
"The way it's handled is that the process where the previous socket was connected remains in place until it terminates but all new sockets connect to the new code."

That would imply that two separate processes are bound to the same port right? I thought that was not possible.

Re:How We Designed for Performance and Scale by ericmoritz on Wednesday June 10, 2015 @02:28PM (#9694312)
No, usually there's an accept process spawning working processes and passing the connection off to it.

Erlang can have two versions of a module present in memory at a time. At the moment of a code upgrade, the processes working with existing connections continue to use the old code while newly accepted connections are passed to the version of the module that was loaded in between connection accepts.

Re:How We Designed for Performance and Scale by ericmoritz on Wednesday June 10, 2015 @02:30PM (#9694320)
Keep in mind that Erlang processes != System processes. Erlang processes are preemptively scheduled microthreads that are scheduled by the Erlang VM.
Re:How We Designed for Performance and Scale by SEJeff on Wednesday June 10, 2015 @02:24PM (#9694283)
Things have changed :)

https://lwn.net/Articles/542629/

Re:How We Designed for Performance and Scale by bkirkbri on Wednesday June 10, 2015 @02:37PM (#9694374)
If only the JVM could take advantage of this.
Re:How We Designed for Performance and Scale by SEJeff on Wednesday June 10, 2015 @05:03PM (#9695370)
Just about bet you could do that via some grotesque JNI work, but I wouldn't wish JNI on really anyone.
Re:How We Designed for Performance and Scale by noselasd on Wednesday June 10, 2015 @05:02PM (#9695357)
While there are certain socket options to share a port - two processes can share a port easily in another elegant way; just call fork().

One way of doing such upgrades is then for the existing code to fork() then exec() the new version. The existing old code closes the original server socket, which leaves accepting new requests to the new code. When all in-flight requests served by the old code is finished, that process can exit.

Re:How We Designed for Performance and Scale by rb12345 on Wednesday June 10, 2015 @02:52PM (#9694459)
Presumably the original server process uses exec() to start the new process, which inherits the open socket handles, and the descriptor is passed as an argument to the new process.

(e.g. http://stackoverflow.com/questions/14351147/perl-passing-an-...)