Skip to content

Commit

Permalink
ovsdb-server: Eliminating max session limit
Browse files Browse the repository at this point in the history
This patch removes limits on number of concurrent sessions
allowed by ovsdb-server. Historically, it was not an design
goal for OVSDB server to support very high number of sessions.
The imposed limit reflects those design choices.

Work is now underway to improve OVSDB scalability since supporting
large of number of sessions is important for OVN, Removing
this limit makes scalability testing possible.

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Han Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Feb 11, 2016
1 parent 4080dd7 commit acdd076
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Post-v2.5.0
bitrot.
- ovs-appctl:
* New "vlog/close" command.
- ovsdb-server:
* Remove max number of sessions limit, to enable connection scaling
testing.


v2.5.0 - xx xxx xxxx
Expand Down
35 changes: 14 additions & 21 deletions ovsdb/jsonrpc-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static struct json *ovsdb_jsonrpc_monitor_compose_update(

struct ovsdb_jsonrpc_server {
struct ovsdb_server up;
unsigned int n_sessions, max_sessions;
unsigned int n_sessions;
struct shash remotes; /* Contains "struct ovsdb_jsonrpc_remote *"s. */
};

Expand Down Expand Up @@ -130,7 +130,6 @@ ovsdb_jsonrpc_server_create(void)
{
struct ovsdb_jsonrpc_server *server = xzalloc(sizeof *server);
ovsdb_server_init(&server->up);
server->max_sessions = 330; /* Random limit. */
shash_init(&server->remotes);
return server;
}
Expand Down Expand Up @@ -324,25 +323,19 @@ ovsdb_jsonrpc_server_run(struct ovsdb_jsonrpc_server *svr)
struct ovsdb_jsonrpc_remote *remote = node->data;

if (remote->listener) {
if (svr->n_sessions < svr->max_sessions) {
struct stream *stream;
int error;

error = pstream_accept(remote->listener, &stream);
if (!error) {
struct jsonrpc_session *js;
js = jsonrpc_session_open_unreliably(jsonrpc_open(stream),
remote->dscp);
ovsdb_jsonrpc_session_create(remote, js);
} else if (error != EAGAIN) {
VLOG_WARN_RL(&rl, "%s: accept failed: %s",
pstream_get_name(remote->listener),
ovs_strerror(error));
}
} else {
VLOG_WARN_RL(&rl, "%s: connection exceeded maximum (%d)",
struct stream *stream;
int error;

error = pstream_accept(remote->listener, &stream);
if (!error) {
struct jsonrpc_session *js;
js = jsonrpc_session_open_unreliably(jsonrpc_open(stream),
remote->dscp);
ovsdb_jsonrpc_session_create(remote, js);
} else if (error != EAGAIN) {
VLOG_WARN_RL(&rl, "%s: accept failed: %s",
pstream_get_name(remote->listener),
svr->max_sessions);
ovs_strerror(error));
}
}

Expand All @@ -358,7 +351,7 @@ ovsdb_jsonrpc_server_wait(struct ovsdb_jsonrpc_server *svr)
SHASH_FOR_EACH (node, &svr->remotes) {
struct ovsdb_jsonrpc_remote *remote = node->data;

if (remote->listener && svr->n_sessions < svr->max_sessions) {
if (remote->listener) {
pstream_wait(remote->listener);
}

Expand Down

0 comments on commit acdd076

Please sign in to comment.