go-siris / siris

DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Other
142 stars 16 forks source link

Reuse-Port #3

Closed godofdream closed 7 years ago

godofdream commented 7 years ago

The Portlistener can be enhanced. Fasthttp can use something called "reuse_port" We should implement it

Dexus commented 7 years ago

Some infos about it: https://github.com/valyala/fasthttp/blob/master/reuseport/reuseport.go https://github.com/valyala/tcplisten

Performance optimization tips for multi-core systems

Allendar commented 7 years ago

This is only meant to run on Linux/BSD distros? macOS runs POSIX certified BSD core with a custom kernel, but when I turn this feature on (as a test), the server just stops instantly without an error or prompt.

Dexus commented 7 years ago

For now yes, with all the features its possible. Like the original source for this feature.

Von meinem iPhone gesendet

Am 08.07.2017 um 16:54 schrieb Allendar notifications@github.com:

This is only meant to run on Linux/BSD distros? macOS runs POSIX certified BSD core with a custom kernel, but when I turn this feature on (as a test), the server just stops instantly without an error or prompt.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

Allendar commented 7 years ago

Would there be an explanation for the server instantly shutting down without warnings on macOS? Maybe it's an interpretal thing, or a bug?

Dexus commented 7 years ago

Look into go-siris/tcplistener when you find there a bug or something... let me know i dont see any known bugs there.

Allendar commented 7 years ago

https://github.com/go-siris/siris/blob/master/vendor/gopkg.in/go-siris/tcplisten.v1/tcplisten.go#L132

On macOS it says it's tcp and thus makes it panic. Would that be a legit alias for tcp4 or is that not safe enough?

Update: If I temporarly alias tcp to tcp4 everything seems to run well. But as I don't have much knowledge of the internal workings, I'm not sure that is the safest way.

Dexus commented 7 years ago

Damn, you are right. There is a aliase needed.