My part of the project included creating the Mod_X Apache Web server module and the X-Switch Java Servlet engine.
- Incorporate an existing Web server (Apache) front-end into the X-Switch system by using the Web server API to route specific requests to the X-Switch system via a TCP/IP socket connection.
- Create an execution environment for Java Servlets that can integrate into the X-Switch system as a component engine.
- Ensure that the execution environment is sufficiently lightweight and efficient.
- Evaluate the Apache Web server and Servlet engine to ensure that they do indeed meet the criteria mentioned above.
Future Work Page
Mod_X - Mod_X is a custom module for the Apache Web server that provides a means of routing requests from the Apache Web server to the X-Switch system. Mod_X utilises the custom handlers and configuration directives of the Apache Web server API. Mod_X uses the DSO functionality of the Apache Web server. This means that the mod_X module can be loaded into Apache at runtime. This eases the installation procedure as no recompilation of Apache is required.
The module registers certain search strings to Apache, so that Apache knows when to send a request to the module. Upon receiving the request, mod_X connects to the X-Switch module and receives a communication socket for that request. The X-Switch system processes the request and returns the result to mod_X via the dedicated communication socket. This data is sent on to the web server as it is received. Once the script has finished executing and returned all the output, the X-Switch system closes the socket. This lets the mod_X module know that the request had finished and can send a confirmation signal back to the Apache server.
X-Switch Java Servlet Engine - The X-Switch Java Servlet engine is a light-weight, high-performance Java Servlet execution environment. Its was designed to have a low startup cost and use the minumum amount of system resources. These features make it ideal for use in multi-user system and in X-Switch, where multiple instances of an X-Switch Servlet engine may exist simultaneously. The X-Switch Servlet engine achieves a low startup cost by
The X-Switch Servlet engine is also optimised to increase performance by utilising techniques such as thread pooling and class buffering. The thread pooling technique initialises a set of threads during engine startup phase and maintains their persistence until engine shutdown. The aim of which is to remove the cost of repetitive thread initialisation during runtime.
The class buffering reduces the number of disk access the container has to make by storing Servlets that it has already read in a memory buffer. This solution avoids the bottleneck of file I/O and thus speeds up the overall execution of the scripts. The class buffering checks whether a buffered Servlet has been updated on the filesystem before deciding to use the buffered Servlet. This ensures that only the latest version of a Servlet will be executed.