Issue Details (XML | Word | Printable)

Key: LEP-7489
Type: New Feature New Feature
Status: Closed Closed
Resolution: Duplicate
Priority: Minor Minor
Assignee: SE Support
Reporter: Alf Høgemark
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
INTERNAL - Old Liferay Portal (Use Liferay Portal Standard Edition)

Expose Ehcache JMX beans, to be able to easily solve performance issues

Created: 13/Sep/08 07:53 AM   Updated: 13/Sep/08 10:05 AM
Component/s: None
Affects Version/s: 5.1.1
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
It would be great if the Ehcache JMX beans were exposed, so that we could use tools like VisualVM to look at the Ehcache configuration used by Liferay, and most importantly, to see the Ehcache statistics.
This will make it a lot easier to see where cache misses are occuring, and see how configuration files should be edited.

You can read an article about how I patched Liferay 5 slightly to expose the Ehcache JMX cache beans at : http://www.kanonbra.com/index.php/projects/performance-testing/18-using-visualvm-on-liferay

If Liferay is upgraded to use ehcache version 1.5, it is easier to expose the JMX beans, as mentioned here : http://ehcache.sourceforge.net/javadoc/net/sf/ehcache/management/ManagementService.html
Then we could just have a config setting in Liferay, and depending on that value, the Liferay could could register the Ehcache beans.

If you choose to not upgrade the Ehcache version, you could solve this enhancement request by changing the code similair to what I did :

Change com.liferay.portal.cache.EhcachePortalCacheManager class :
Add
import javax.management.MBeanServer;
import java.lang.management.ManagementFactory;
import net.sf.ehcache.management.ManagementService;

and change the "afterPropertiesSet" method to look like this, by adding the last three lines :

    public void afterPropertiesSet() {
        URL url = getClass().getResource(PropsUtil.get(_configPropertyKey));

        _cacheManager = new CacheManager(url);
        // Register Ehcache JMX beans
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        ManagementService.registerMBeans(_cacheManager, mBeanServer, true, true, true, true);
    }

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Raymond Auge added a comment - 13/Sep/08 10:05 AM
This was recently solve by LEP-7478.