UserInstance Cache Analysis

Background Summary

uPortal makes use of caches (home grown) to improve the performance. Some of these cache implementations are not very optimal. Unicon took an attempt to optamize the User layout caches. They sent patch to RUTGERS. We implemented this patch on our implementation of uPortal (myRutgers). We did a comparative load test.
Implementing Unicon's cache-key fix seems to have noticeably improved portal performance across the board, with the biggest absolute savings in time occurring during the login and options channel rendering phase.

With 50 concurrent users:
4% improvement in login times
(6.007 vs 6.248 sec avg, std dev 1.172,1.229 resp.)
20% improvement in rendering the options channel
(0.972 vs 1.212 sec avg, std dev 0.444, .597 resp.)
20-30% improvement in page rendering time

With 80 concurrent users:
28% improvement in login times
(8.252 vs 11.383 sec avg, std dev 2.208,3.965 resp.)
43% improvement in rendering the options channel
(2.433 vs 4.249 sec avg, std dev 1.414,2.527 resp.)
50-70% improvement in page rendering time

The changes that Unicon did with the UserInstance.java were small but very invasive. We at RUTGERS decided to look into these changes as a team.

A series of meeting will follow and discussion will be posted in this page.

Code Review (6/13/2005)

A code review was done on the implemented patch for layout cache optamization. Following are the comments came out from the code review.

  1. SimpleUserLayoutManager.java line 742 ->Use System.currentTimeMillis() rather than creating new Date instance and geting the current time ()
  2. UserInstance.java line 417 -> Change to static reference
  3. UserInstance.java line 148 -> The softHash maps (systemCache UP-1145, systemCharacterCache )are probably not thread safe. They should be made synchronized.
  4. UserInstance.java line 731 -> Remove IPerson input parameter from the method constructCacheKey()
  5. Investigate what is stored in the cachekey, Does cachekey tied to user session etc.

Post Code Review (6/17/2005)

An investigation was done on the original userInstance cache implementation (non optimized version) to better understand the cache. Following is the link to the document that summarizes the cache implementation. http://jasigch.princeton.edu:9000/display/UPC/Layout+Caching

Following are the action items came out of discussion in this meeting.

1- Investigate if channelSubscribeId is unique/non-unique (shared between users) to a user.
2- Do similar analysis with the optimized version of caches as we did on non optamized version. We basically want to determine with the optimized cach implementation

  • Whether two users have same cache key and cache content (Do they get cache hit if they have same layout)