Make TCP_KEEPIDLE configurable

Addresses LP bug #1031794.

Change-Id: I9a3a6a23b1bcec5229b15234512e04cc47c3ffd9
This commit is contained in:
Stuart McLaren 2012-08-01 14:25:30 +00:00
parent eeedad3333
commit efb30dd640
4 changed files with 18 additions and 1 deletions

View File

@ -152,6 +152,13 @@ Number of backlog requests to configure the socket with.
Optional. Default: ``4096``
* ``tcp_keepidle=SECONDS``
Sets the value of TCP_KEEPIDLE in seconds for each server socket.
Not supported on OS X.
Optional. Default: ``600``
* ``workers=PROCESSES``
Number of Glance API worker processes to start. Each worker

View File

@ -32,6 +32,10 @@ log_file = /var/log/glance/api.log
# Backlog requests when creating socket
backlog = 4096
# TCP_KEEPIDLE value in seconds when creating socket.
# Not supported on OS X.
# tcp_keepidle = 600
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine

View File

@ -18,6 +18,10 @@ log_file = /var/log/glance/registry.log
# Backlog requests when creating socket
backlog = 4096
# TCP_KEEPIDLE value in seconds when creating socket.
# Not supported on OS X.
# tcp_keepidle = 600
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine

View File

@ -52,6 +52,7 @@ bind_opts = [
socket_opts = [
cfg.IntOpt('backlog', default=4096),
cfg.IntOpt('tcp_keepidle', default=600),
cfg.StrOpt('cert_file'),
cfg.StrOpt('key_file'),
]
@ -130,7 +131,8 @@ def get_socket(default_port):
# This option isn't available in the OS X version of eventlet
if hasattr(socket, 'TCP_KEEPIDLE'):
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 600)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE,
CONF.tcp_keepidle)
return sock