Skip to content

Commit 710ddb5

Browse files
Increased from 30 to 40 the maximum connections from a service
This is not really justified by anything, but 30 seemed small and from tests on my machine 40 do not cause any problem. The only service using these many connections is CWS, and having too many users per CWS might create pool exhausted errors. Also added a couple of warning in AWS in case there are too many users per CWS.
1 parent 4a31176 commit 710ddb5

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

cms/db/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Contest Management System - http://cms-dev.github.io/
55
# Copyright © 2010-2012 Giovanni Mascellani <mascellani@poisson.phc.unipi.it>
6-
# Copyright © 2010-2014 Stefano Maggiolo <s.maggiolo@gmail.com>
6+
# Copyright © 2010-2015 Stefano Maggiolo <s.maggiolo@gmail.com>
77
# Copyright © 2010-2012 Matteo Boscariol <boscarim@hotmail.com>
88
# Copyright © 2013 Bernard Blackham <bernard@largestprime.net>
99
# Copyright © 2013 Luca Wehrstedt <luca.wehrstedt@gmail.com>
@@ -83,7 +83,7 @@
8383

8484

8585
engine = create_engine(config.database, echo=config.database_debug,
86-
pool_size=20, pool_recycle=120)
86+
pool_size=20, max_overflow=20, pool_recycle=120)
8787

8888

8989
from .session import Session, ScopedSession, SessionGen, \

cms/server/templates/admin/contest.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
<h1>Contest information</h1>
66
</div>
77

8+
{% if len(config.contest_listen_port) > 0 %}
9+
{% set ratio = round(len(contest.users) * 1.0 / len(config.contest_listen_port), 2) %}
10+
{% if ratio >= 40 %}
11+
At the moment, you have {{ ratio }} users for each ContestWebServer, on average.<br/>
12+
A CWS can handle 40 simultaneous request. This situation might cause many requests to fail.
13+
{% end %}
14+
{% end %}
15+
816
<!-- We use "multipart/form-data" to have Tornado distinguish between missing and empty values. -->
917
<form enctype="multipart/form-data" action="{{ url_root }}/contest/{{ contest.id }}" method="POST" name="edit_contest">
1018
<table class="sub_table">

cms/server/templates/admin/userlist.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
<div class="core_title">
55
<h1>Users list</h1>
66
</div>
7+
8+
{% if len(config.contest_listen_port) > 0 %}
9+
{% set ratio = round(len(contest.users) * 1.0 / len(config.contest_listen_port), 2) %}
10+
{% if ratio >= 40 %}
11+
At the moment, you have {{ ratio }} users for each ContestWebServer, on average.<br/>
12+
A CWS can handle 40 simultaneous request. This situation might cause many requests to fail.
13+
{% end %}
14+
{% end %}
15+
716
<a href="{{ url_root }}/add_user/{{ contest.id }}">Add a new user</a>
817
<table class="bordered">
918
<thead>

0 commit comments

Comments
 (0)