The tcp_keepalives parameters at the OS level are similar to tcp_keepalive parameters in the DB level.
The difference is that if the tcp_keepalives parameters are set at the OS level it will affect everything on the system. Whereas, if they are set only at the DB level it will only affect the DB connections.
It is best to adjust the parameters at the DB level first. Ensure that the parameters set at the OS level are higher than what they are set at the DB level. If a shorter time period is set at the OS level, then the connections will be closed earlier than what has been set at the DB level.
The tcp_keepalive parameters in the Greenplum Database are:
tcp_keepalives_interval tcp_keepalives_idle tcp_keepalives_count
Note: More information on these parameters can be found in the Greenplum System Administrators Guide.