# Atenea Exams, an IMS LTI Application to Solve Scalability Problems: A Study Case
## 3 Solution and Results
### A solution to Cope with Scalability Issues in Atenea
#### 3.2.1. Atenea: System Architecture  
As mentioned above, with the adoption of Moodle as a teaching support platform, the UPC does an investment in the university's internal talent. Recently, Moodle.com, the company responsible for the development and distribution of Moodle, established its second headquarters in Barcelona, and has hired several people from UPC and UPC-Net [15]. As a result of the university's involvement with Moodle, several research and development projects are being carried out which have as a relevant result for this article, the incorporation of two new interoperability technologies into the Moodle system itself. The Moodle-based Atenea virtual campus must serve as a training support platform at the UPC for [25]:  
* 22,682 undergraduate students
* 5269 master's degree students
* 2210 doctoral students
* 2870 continuing education students
* 64 undergraduate studies
* 75 university master's degree programs
* 46 doctoral programs
* 234 continuing education programs  
The Atenea platform has considerable quality and performance requirements. It was estimated that the platform should handle at least 5000 simultaneous requests, and offer high availability. It is not acceptable for the platform to fall, for example, in the middle of a questionnaire-type exam. The Atenea platform needs to be available 24/7 throughout all year. The service only stops very occasionally for maintenance, usually on weekends and with notice to the faculty so it does not interfere with academic activity, like deadlines for task deliveries. Since its migration to the private cloud architecture these services interruptions are rare. Therefore, a study had to be conducted to ascertain scalability and reliability parameters. Moodle works in a simple LAMP environment (Linux, Apache, MySQL and PHP), which can be installed and run on a low-end PC from 2004. However, if one needs to support a large number of simultaneous connections, as many as 9000, there is a major scalability problem as there are several bottlenecks to be solved. Moodle, since its version 1.4, supported PostgreSQL, a more robust and scalable database than MySQL at the time. A first step in increasing Moodle performance was to move the database server to a dedicated, optimized machine. However, the adjustment was not enough for the scalability requirements, as 9000 possible concurrent transactions far exceed what a PHP application server can support. At that time two alternatives were presented [26]:  
* Multi-instance Moodle: implement Atenea with several instances of Moodle, separated by the organizational context (School, degree, campus). See Figure 8.
* One single high-performance Moodle instance: work in a single instance, with code, database and file system shared by several servers working in parallel. See Figure 9.  
The first option involves greater complexity in the software. The second option involves greater complexity in the configuration of systems. In the following paragraphs we are going to discuss the advantages and disadvantages of both options and the final selected architecture UPC adopted. The first option (called multi-instance Moodle) is based on the creation of a first web application as a point of entry and user authentication. After logging in, users find a list of links to the courses where they are enrolled. When you click on a link, the user is directed to the server hosting the specific Moodle course. Instead of operating a single instance of high-performance Moodle, it works with multiple instances that receive a usage load within their performance parameters. This option has the following advantages:  
* It works with Moodle instances with workloads that servers know they can take on. * At a time when the speed of Internet connection was limited in some of the UPC Campuses (the UPC has a Campus in 7 different locations in the province of Barcelona back in 2004), the machines that serve the Moodle instances can be located in each campus to provide a good service.