|
Note: Resin HardCore is experimental. Resin HardCore is a Linux kernel module. By pulling the webserver into the kernel single-computer Resin servers and load-balanced servers can greatly improve their performance. HardCore replaces Apache as a web-server, grabbing HTTP requests and passing them to the backend Resin JVMs. Because HardCore operates entirely in the kernel, it has very low overhead.
Resin HardCore works much like the Apache/mod_caucho combination. When a new browser request appears on port 80, it accepts the request and parses the HTTP header. It then selects a JVM and forwards the request to the backend servlet runner. When the servlet runner responds, HardCore will send the response to the browser. Unlike Apache/mod_caucho, HardCore passes every request to the servlet runner. In essence, it's a kernel proxy. Restricting HardCore to a proxy tremendously simplifies the configuration and maintenance -- an important consideration when writing a kernel application. Because HardCore is entirely in kernel space, it can quickly forward the requests without slow context switches or copying from user space. Once the load-balancing is complete, an Linux box can serve as a low cost sticky-session load balancer with much better performance than an Apache load balancer.
The Resin ./configure script will select the Linux sources. The standard make; make install will put a in resin-2.0.x/libexec. is the actual kernel module.For standard configurations, ./configure will find the source, but you can change it with configure arguments (or in the Makefile).
Once you've got a resin.o in libexec, you can install it as a module. The Linux command is .HardCore can take an optional argument, , to select the server port. It defaults to the standard HTTP port 80.
Once as a module, HardCore creates the directory for configuration. It currently contains three files: to configure the listening port, to specify the number of load balancing servlet-runners, and to configure each servlet runner.
You can look at those files to see their values:
You can also configure to change the servlet runner.
Any bugs in HardCore will likely crash or freeze your computer. In theory it could also do bad things to the filesystem, although that hasn't happened to us ... yet. Working with kernel modules is not as safe as a C program and nowhere near as safe as running a Java program. The 12/21 version handles basic GET requests. The current errata:
|