Playframework 2.5 Neety server Connection:keep-Alive not working as expected

105 views
Skip to first unread message

Venkatesh

unread,
Sep 20, 2017, 6:41:09 AM9/20/17
to Play Framework

As per the Playframework 2.5 docs we have configured as below. However, it is not working as expected. In response header, we are not getting connection as keep-Alive

    play.server {
  # The server provider class name
  provider = "play.core.server.NettyServerProvider" 
  netty {
  # Whether the Netty wire should be logged
  log.wire = true
  # If you run Play on Linux, you can use Netty's native socket transport
  # for higher performance with less garbage.
  #transport = "native"
    option {
        child {
            # Set whether connections should use TCP keep alive
            SO_KEEPALIVE = true
            TCP_USER_TIMEOUT = 5
            # Set whether the TCP no delay flag is set
            # TCP_NODELAY = false
         }
    }
  }
}

Igmar Palsenberg

unread,
Sep 20, 2017, 6:47:53 AM9/20/17
to Play Framework


Op woensdag 20 september 2017 12:41:09 UTC+2 schreef Venkatesh:
Like the comment says : SO_KEEPALIVE is TCP option, and only visible when doing a tcpdump. This option has nothing todo with the HTTP keepalive, which goal is to re-use HTTP connections.
Netty does keep-alive on a HTTP level by default, if the HTTP protocol >= 1.1, and the client is requesting keepalive.

So, there is no need to set any option on Netty side.


Igmar 

Will Sargent

unread,
Sep 20, 2017, 12:26:51 PM9/20/17
to play-fr...@googlegroups.com
You may want to tune nginx for keepalive though if you're using it as a front end proxy:


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/9a68d8f3-ac70-4d09-85e7-ceafe7bd5d0c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages