[contestms] Re: Handling large number of total users/submissions

  • From: Giovanni Mascellani <mascellani@xxxxxxxxxxxxxxxxxxxx>
  • To: contestms@xxxxxxxxxxxxx
  • Date: Tue, 22 Apr 2014 18:04:48 +0200

Hi.

Il 22/04/2014 10:01, Luca Wehrstedt ha scritto:
> Your numbers are more than double the size of an IOI (300 contestants,
> 3000-4000 submissions), we therefore don't have any prior experience.
> Nevertheless I'm confident CMS will support it.
> 
> On the database level, one thing you might want to look into is adding
> indexes to make queries perform faster. We never really felt the need,
> but in your case it could be advisable to have them. I'm not an expert
> on that but I believe there are tools that analyze the queries performed
> on a database and tell you which indexes will bring the largest benefit.

I don't think this would be particularly important. There should already
be some indexes and you're hardly getting much more from them. If you
really want to delve better in the topic, I think that the only tables
that may be relevant to check are "evaluations" and linked tables, i.e.,
those which really hold hundreds of thousands of rows or more.

> On CMS's level, I see a couple of possible performance issues. I'd say
> 4-5 ContestWebServers are enough, but there's the database connection
> issue that you reported (and that we didn't diagnose yet) that may hit
> you again. Set up pgbouncer and be ready to spawn new ContestWebServers,
> just in case. I'm also doubtful that 8-9 Workers will sustain that many
> submissions: again, be ready to spawn more. (At the IOI2012 we had about
> 80 Workers but just a handful of them were active simultaneously:
> unfortunately I don't remember the exact number). I don't have
> information about the performance of other services, but I believe them
> to be able to manage such a contest.

I would add some other Workers too. At the moment you should have
20000/3/60/8 =~ 13 submission per minute to process (assuming that all
submissions are concentrated in the last three hours of contest), which
is not few (unless you have really few testcases).

Also take care that we still have #254[1], which doesn't appear to harm,
but it is not fully diagnosed either (and, anyway, would make you lose
additional Worker time by doing twice the same Job). Raising
JOBS_NOT_DONE_CHECK_TIME may help.

 [1] https://github.com/cms-dev/cms/issues/254

If you have time, I would also suggest you to do some preventive stress
testing on your infrastructure. We already have some software to do it
(have a look at StressTest.py and ReplayContest.py in cmstestsuite/
directory), but it is rather old and there is probably a lot of dust on
it. For instance, a few weeks ago Luca Chiodini complained on this
mailing list that StressTest had a problem, but I didn't have time to
check it out and most probably I won't in the near future.

Good luck for the contest!

Giovanni.
-- 
Giovanni Mascellani <giovanni.mascellani@xxxxxx>
PhD Student - Scuola Normale Superiore, Pisa, Italy

http://poisson.phc.unipi.it/~mascellani

Attachment: signature.asc
Description: OpenPGP digital signature

Other related posts: