Skip to content

Commit

Permalink
RGW:add socket backlog setting for via ceph.conf
Browse files Browse the repository at this point in the history
http://tracker.ceph.com/issues/16406

Signed-off-by: Feng Guo <diluga@gmail.com>
  • Loading branch information
diluga committed Jun 24, 2016
1 parent f7fc985 commit 3e4df83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -1360,6 +1360,7 @@ OPTION(rgw_enable_usage_log, OPT_BOOL, false) // enable logging bandwidth usage
OPTION(rgw_ops_log_rados, OPT_BOOL, true) // whether ops log should go to rados
OPTION(rgw_ops_log_socket_path, OPT_STR, "") // path to unix domain socket where ops log can go
OPTION(rgw_ops_log_data_backlog, OPT_INT, 5 << 20) // max data backlog for ops log
OPTION(rgw_fcgi_socket_backlog, OPT_INT, 1024) // socket backlog for fcgi
OPTION(rgw_usage_log_flush_threshold, OPT_INT, 1024) // threshold to flush pending log data
OPTION(rgw_usage_log_tick_interval, OPT_INT, 30) // flush pending log data every X seconds
OPTION(rgw_intent_log_object_name, OPT_STR, "%Y-%m-%d-%i-%n") // man date to see codes (a subset are supported)
Expand Down
6 changes: 4 additions & 2 deletions src/rgw/rgw_fcgi_process.cc
Expand Up @@ -20,10 +20,12 @@ void RGWFCGXProcess::run()
string socket_path;
string socket_port;
string socket_host;
int socket_backlog;

conf->get_val("socket_path", "", &socket_path);
conf->get_val("socket_port", g_conf->rgw_port, &socket_port);
conf->get_val("socket_host", g_conf->rgw_host, &socket_host);
socket_backlog = g_conf->rgw_fcgi_socket_backlog;

if (socket_path.empty() && socket_port.empty() && socket_host.empty()) {
socket_path = g_conf->rgw_socket_path;
Expand Down Expand Up @@ -54,7 +56,7 @@ void RGWFCGXProcess::run()
}

const char *path = path_str.c_str();
sock_fd = FCGX_OpenSocket(path, SOCKET_BACKLOG);
sock_fd = FCGX_OpenSocket(path, socket_backlog);
if (sock_fd < 0) {
dout(0) << "ERROR: FCGX_OpenSocket (" << path << ") returned "
<< sock_fd << dendl;
Expand All @@ -66,7 +68,7 @@ void RGWFCGXProcess::run()
}
} else if (!socket_port.empty()) {
string bind = socket_host + ":" + socket_port;
sock_fd = FCGX_OpenSocket(bind.c_str(), SOCKET_BACKLOG);
sock_fd = FCGX_OpenSocket(bind.c_str(), socket_backlog);
if (sock_fd < 0) {
dout(0) << "ERROR: FCGX_OpenSocket (" << bind.c_str() << ") returned "
<< sock_fd << dendl;
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_process.h
Expand Up @@ -21,7 +21,6 @@
#define def_dout_subsys
#endif

#define SOCKET_BACKLOG 1024

extern void signal_shutdown();

Expand Down

0 comments on commit 3e4df83

Please sign in to comment.