progzoo.php - the hook, when a question tag is found it runs them through a couple of xsl files.

question.xsl - assembles the user controls (the text box and the Run button)

blurb.xsl - the question text is extracted and processed by wiki

Zoo skin

The Zoo skin is based on Mozilla's Devmo skin. The Zoo skin has language tabs to allow users to flip between Java, C#, Perl,... It hides most of the Wiki controls. Progzoo 'should' work with other skins.

Back end

A number of servers are used to process users programs.
Access to the servers is limited by the queues.
Currently there are three queues, javaq, crunchie and cardington, these are represented by the structure $mList which is at the beginning of /home/andrew/public_html/progzoo/r.cgi

Note that java is the heaviest load, two machines are attached to the javaq. The queuing algorithm will choose the machine with the fewest jobs running (it only counts processes from the queue). The first listed is prefered. Crunchie is dedicated to Windows and so handles C# and VB. The queue Cardington handles all other languages, it shares the second Java machine.

The number of processes maxProcesses allowed is 4 (number of cpu's times 2). The amount of memory dedicated to the UML is 228M. These values took some time to establish, too much memory (512M is too much) and the host falls over, too little and the virtual machine pack up when running java graphics programs (128M is too little).

The UMLs are run by user andrew from a screen session. Use of cow (copy on write) files means that the image pz.fs cannot be damaged.

UML image
The UML image pz.fs includes mysql, java and all the compilers required. It runs apache. The perl script f.cgi compiles and executes the code. Before compiling and executing it uses ulimit to restrict

the memory

cpu time

elapsed time

number of processes

These are all very generous but hopefully not fatally so.

Queues

The queue is stored in /tmp/ for example /tmp/java and /tmp/crunchie
See Panic for details of how to fix broken queues.

Procedure for changing the image

To change the image (if we introduce a new language or library for example) we must start the VM without COW.