We’re excited to introduce the Portlet Sandbox plugin which can greatly improve portal resiliency and stability. This new plugin does so by isolating high-traffic or resource-hungry portlets. It prevents unstable portlets from crashing portal JVM (Java Virtual Machine). Memory leaks or other stability issues of a single portlet or a group of portlets do not terminate the entire portal, instead their services will be offline for a short period of time and system will automatically recover by restarting or disabling the offending components. With Portlet Sandbox you improve your portal’s resiliency against things like misbehaving custom portlets. Enterprises with multiple development teams deploying to a single instance can reduce their impacts on one another by isolating their portlets to their own sandboxes.
The Portlet Sandbox has a very similar concept comparing to WSRP. WSRP allows us to treat portlets as enterprise services, accessing them via web services. However, WSRP has excessive overhead due to request marshalling, single sign-on, and a variety of other factors. The Portlet Sandbox runs isolated portlets in different JVMs on the local machine. It ensures the lowest communication level possible to reduce overhead. The communication between the MPP (Master Portal Process) and PSC (Portlet Sandbox Container) processes are implemented by a private RPC (Remote Procedure Call) framework over pipes (POSIX mkfifo) or sockets (Windows). The communication utilizes a private binary protocol, there is no SOAP overhead as WSRP does. Since all JVM processes run in the same machine, static resource (javascript, css, etc.) are served directly by the MPP, only the portlets accessing are isolated by the Portlet Sandbox. By breaking the entire portal into multiple JVM processes, each JVM can have a smaller heap size which eases the GC (Garbage Collector) overhead and improve the system memory utilization.
In cluster setup, each cluster node can be independently configured for the Portlet Sandbox. The MPP and PSCs on the same machine are logically considered as a single traditional cluster node that interacts with other cluster nodes. When requests are dispatched to a cluster node, MPP first takes over, and then delegates to proper PSCs based on the configuration. The combination of cluster and Portlet Sandbox can help the system to scale-out (on multiple machines) and scale-up (on high-end machines).
Would you like to try it out? The Portlet Sandbox plugin is available today in the Liferay Marketplace. It is free for Liferay Portal Enterprise Subscribers. Documentation for the plugin is also available now.
If you’re not yet using Liferay, check out our free 30-day trial or request a quote and see if the Liferay Portal Enterprise Subscription is right for you.


