Portal Cache - Oracle Software Downloads
Download
Report
Transcript Portal Cache - Oracle Software Downloads
Jason Pepper
Principal Product Manager
Oracle Corporation
Tips & Techniques
for Deploying a
Scalable Portal
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Why Portals?
Enable integrated,
secure access to all
information sources
Support
personalized views
for different users
and communities
The Portal Challenge?
How to make it
Popular…
…and Fast!
Or, how to make it Scale?
How to make your Portal
scale?
Cross platform
–
Choose the most cost-effective platform for
each component
Distributed
–
Spread the load across servers
Parallel execution
–
Use multiple threads to access
content
Cache, Cache, Cache
Intelligent Caching
Keep information fresh and timely
while minimizing the cost of dynamic,
personalized content
Must support:
–
–
–
Personalization
Modularity – pages and page fragments
Page, Portlet, and Item-level security
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
OracleAS Portal Page Generation
OracleAS Portal Middle Tier
mod_plsql
Parallel
Page
Engine
Page
Response
OracleAS Portal
Database Tier
Page
Metadata
mod_oc4j
Page
Request
Oracle HTTP Server
Browser Client
Cached
Metadata
& Content
Portal
Cache
Portal
Repository
Portlet
Content
Portlet
Content
Web
Provider
Database
Provider
My Oracle Architecture
OracleAS Portal Page Generation
OracleAS Portal
Middle Tier
mod_plsql
Parallel
Page
Engine
Page
Response
OracleAS Portal
Database Tier
Page
Metadata
mod_oc4j
Page
Request
Oracle HTTP Server
Browser
Client
Cached
Metadata
& Content
Portal
Cache
Portal
Repository
Portlet
Content
Portlet
Content
Web
Provider
Database
Provider
OracleAS Web Cache
Memory-based cache
Combines caching,
compression, and assembly
to accelerate both static and
dynamic content
Also provides load-balancing,
failover, and surge protection
to improve availability,
reliability
Portal functions as “Origin
Server”
Portal Use of Web Cache
Automatically installed and configured
UI for global cache settings and invalidation (by user,
by object, or for entire cache)
Features used :
–
–
–
–
–
Caching of dynamically generated, user-specific page and
portlet content
Fine-grained cache control
Invalidation-based caching
Layer 7 load balancing and failover detection
Performance Assurance and Surge Protection
Web Cache Deployment Options
Single Portal Installation
–
Co-located
Same physical server as Portal
middle tier
OK for smaller sites
–
Dedicated
Web Cache on own server
Preferred option to avoid
resource contention
Performs well on inexpensive
hardware
Web Cache Deployment Options
Multiple Portal Installations and/or Web Providers
–
–
Dedicated
Each installation/provider has its own Web Cache
Better for autonomous administration, load distribution,
firewall protection, network performance
Privilege changes cause invalidation on local site only
Shared
Each installation/provider uses a common Web Cache
Privilege changes cause invalidation across sites
My Oracle Tweaks
Upgraded to Web Cache 904
–
–
–
Compressed CSS bug
Buffer limit incompatibilty 32K
Invalidation propogation fails without identical
config files
Enable session binding to match LBR
Compression rule for non-cacheable pages
using ^/portal/page
OracleAS Portal Page Generation
OracleAS Portal Middle Tier
mod_plsql
Parallel
Page
Engine
Page
Response
OracleAS Portal
Database Tier
Page
Metadata
mod_oc4j
Page
Request
Oracle HTTP Server
Browser Client
Cached
Metadata
& Content
Portal
Cache
Portal
Repository
Portlet
Content
Portlet
Content
Web
Provider
Database
Provider
Portal Middle Tier
OracleAS installation acts
as the Portal middle tier
Portal directly leverages
the following OracleAS
services:
–
–
–
–
Oracle HTTP Server
mod_plsql
mod_oc4j
Web Cache
Oracle HTTP Server
Powered by Apache
De-facto standard web
listener
Serves as the HTTP
entry point to OracleAS
My Oracle Tweaks
KeepAlive Off
MinSpareServers 30
MaxSpareServers 100
StartServers 30
MaxClients 250
MaxRequestsPerChild 2000
mod_oc4j
Apache plug-in
Routes Servlet requests
to OracleAS Containers
for J2EE (OC4J) Servlet
engine
Proven industry leading
performance
Supports latest J2EE
specifications
My Oracle Tweaks
Removed –xingc from opmn.xml
Increased –mx and –ms
cacheDir matched to PlsqlCacheDirectory
TCP.NODELAY = Yes
SDU = 8761
numProcs set in opmn.xml
<oc4j maxRetry="3" instanceName="home" numProcs="2">
<config-file path="/disk2/oracle/midtier/j2ee/home/config/server.xml"/>
<oc4j-option value="-properties"/>
<port ajp="3000-3100" jms="3201-3300" rmi="3101-3200"/>
<environment>
<prop name="LD_LIBRARY_PATH" value="/disk2/oracle/midtier/lib"/>
</environment>
</oc4j>
Parallel Page Engine
Runs as a Servlet
Responsible for page
assembly
Talks to web and database
providers to get portlet content
Leverages local file system
cache to store page definitions
and portlet content
Configurable number of
threads for talking to providers
in parallel
mod_plsql
Translates URL requests
into stored procedure calls
Gateway into Portal
Database
–
Access to Portal Repository,
Portal UI and Database
Providers
Provides connection
pooling for efficient session
management
My Oracle Tweaks
NLS_LANG matches DB setting
PlsqlIdleSessionCleanup = 15 (mins)
PlsqlCacheDirectory aliased to RAM disk
PlsqlCacheTotalSixe = 8Gb
PlsqlCacheMaxAge = 15 (days)
Portal Cache
File system-based
storage for cached
versions of page
definitions and portlet
content
Eliminates the need to
always regenerate pages
and portlets
Provides backup to Web
Cache
OracleAS Portal Page Generation
OracleAS Portal Middle Tier
mod_plsql
Parallel
Page
Engine
Page
Response
OracleAS Portal
Database Tier
Page
Metadata
mod_oc4j
Page
Request
Oracle HTTP Server
Browser Client
Cached
Metadata
& Content
Portal
Cache
Portal
Repository
Portlet
Content
Portlet
Content
Web
Provider
Database
Provider
Portal Database
Portal
Repository
Database
Provider
Foundation of an Oracle Portal
installation
Consists of ~200 tables/views and
over 1000 PL/SQL packages
Portal Databases can be registered
with each other to make up a
federated portal environment
–
departmental portals/installations
can be easily networked together to
form an enterprise portal
Portal Repository
Storage for
–
–
Portal
Repository
–
–
–
Database
Provider
–
provider registry
page and style definitions
user customizations
access controls
definitions of page groups, data-driven
components, etc.
logs
UI screens for creating and editing all of
the portal objects (e.g. pages, items,
charts, etc.)
Database Providers
Portal
Repository
Database
Provider
Hosted out of a Portal Database
Implemented as PL/SQL or Java stored
procedures
Interacts with framework via direct
database procedure calls; results
returned as HTML/XML
Ideal for database-centric applications
Built with PDK-PL/SQL and/or
declarative wizards
–
APIs for preference store, logging,
translation store, security, caching, etc.
OracleAS Portal Page Generation
OracleAS Portal Middle Tier
mod_plsql
Parallel
Page
Engine
Page
Response
OracleAS Portal
Database Tier
Page
Metadata
mod_oc4j
Page
Request
Oracle HTTP Server
Browser Client
Cached
Metadata
& Content
Portal
Cache
Portal
Repository
Portlet
Content
Portlet
Content
Web
Provider
Database
Provider
Web Providers
Work in any web environment
–
Servlet, JSP, ASP, cgi-bin, Perl, etc.
Communication via HTTP; results returned
as HTML/XML
Web
Provider
–
Stuctured data exchange using SOAP
Ideal for adapting existing or remote Web
services
–
allow developers to work in a familiar
development environment
Java PDK
–
–
Helper classes for portlet creation
Provide Java API-level services (storage,
preferences, parameter passing, errors, etc.)
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Page and Portlet Caching
Dynamic page assembly is an expensive operation
–
Places heavy load on providers, database, network, and
middle tier
Caching minimizes database and provider calls
Almost all content and metadata is cached:
–
–
–
–
–
–
Page definitions
Portlet content
Assembled pages
Documents (including images)
Events
Login Metadata
Caching Types
Invalidation-based caching (Web Cache)
–
–
Providers proactively send invalidation message
Content can also expire when maximum cache
retention period is reached (invalidation-withexpiry)
Validation-based caching (Portal Cache)
–
The middle tier contacts the provider to see if the
cache entry is still valid
Expiry-based caching (Portal Cache)
–
PPE checks a time stamp for the cache entry to
see if it is still valid
Choosing a Caching Type
Validation/Invalidation
–
–
Users will always see the most up-to-date information
Use when:
Content changes frequently
Cost of checking validity or triggering invalidation is low
Expiry
–
–
Content cached for specified period of time; may grow stale
Use when:
Content is not time-sensitive
Cost of validation/invalidation is high
User and System Level
Caching
System level
–
–
Cache entries shared by all users,
including public users
Recommended for content that isn’t
protected, or for content that doesn’t
support user customizations
User level
–
–
Cache entries only available to a
specific user
Required for protected content, or for
content that supports user
customizations
Web Cache and User Level
Caching
Web Cache
Sess
1
Sess
2
User
1
Sess
3
User
2
Portal Cache
Sess
4
User-level content keyed by
userid
Can be refreshed from Portal
Cache if invalidation-based
combined with validationbased caching (DB portlets
only)
System-level content in Web
Cache shared across sessions
Page Caching Options
Page Group
Page
Page Caching Options
Cache page definition only
–
–
–
–
–
Page definition (page structure, portlets, items)
cached at user level
Both Web Cache and Portal Cache (invalidation
+ validation)
Refreshed when any change occurs on page,
including customization, items, privileges,
templates, and styles
Page re-assembled on every request
Portlet validity/expiry checked on every request
Page Caching Options
Cache page definition and content for N minutes
–
–
–
–
–
Caches assembled page at user level
Portal Cache only (expiry-based) plus browser
Best for performance
Eliminates definition generation and page assembly
But can result in stale content
Ignores portlet caching options until page expires
Change to page definition will always force a refresh
Page Caching Options
Cache Page Definition Only at System Level
–
–
–
Single cached copy of the page definition in the system
cache for all users.
Page customization options disabled.
Reduces storage requirements and improves performance.
Cache Page Definition And Content at System Level
for [ ] Minutes
–
–
–
Single cached copy of the page definition and page
content, including the rendered content of all portlets.
Page customizations are not possible
Select this option for pages that are more static and are
unlikely to change within the specified period.
Page Caching Options
Don’t cache
–
–
–
Disables page caching
Use sparingly to avoid impact on performance
Use when:
Testing
Page contains PL/SQL items or URL items to
render dynamic content that must be constantly
refreshed (better to use a portlet with short expiry)
Concerned that changes to security can cause
active users to lose privileges on page
Page Caching Options - Summary
Page
Definition
Only
Portlets
where
content must
always be
up-to-date
System
Cache for all
users
Page
Definition
and Content
Static content
Expiry-based
portlets
System
Cache for all
users
Don’t Cache
Dynamic
items that
must be upto-date
Testing
Portlet Caching
Portlet Caching
Content only is cached (not metadata)
–
–
–
Invalidation-based – provider must send
invalidation message
Validation-based – provider contacted to validate
portlet
Expiry-based – provider not contacted until cache
entry expires (different than pages)
Invoked through PDK APIs
Can combine validation + invalidation for DB
portlets
Portlet Caching – System Level
Disables all customization options for the portlet.
Does not enforce access privileges for the portlet.
Displays only public data.
A System cached Page, will cause the portlet to be
cached at the system level.
If Web Provider specifies system-level caching for a
portlet. Cannot change the cache setting for the
portlet manually because it is already set.
Choosing Portlet Caching
Options
Invalidation
Validation
Expiry
Static or Dynamic
content
Real-time +
application can
send invalidation
message
Same as
Invalidation
Use in
combination with
invalidation (DB
Portlets only)
Static content
(choose period to
match update
frequency) e.g.
page banner
Dynamic, not real
time (e.g. delayed
stock quote,
catalogue)
• Don’t cache if content must be real-time and the application
cannot trigger an invalidation message
Document and Image Caching
Documents and Images in Portal Repository
(/docs)
–
–
Cached in Portal Cache only (for security)
Exceptions: Category, Perspective, Style
Documents and Images from File System
–
–
–
Default: Cached in Web Cache “forever”
Portal /images directory set to expire after 30
days
Recommended for widely used images (e.g.
logo, banner icons)
Other Cacheable Objects
Event Metadata
–
–
–
–
–
New feature
Portlets can publish/subscribe to events (e.g. push button,
click link, select value)
Minimizes coding; makes portlets more reusable
Supports inter-portlet and inter-page communication via
formal parameters
Same caching model as pages (invalidation + validation)
Login Metadata
–
–
–
Describes the current session
Passed to providers that want to track state
Cached in Web Cache
Invalidation Events
Two types:
–
–
Hard Invalidations: Happen immediately
Soft Invalidations: Deferred to avoid processing spikes
Affect both Web Cache and Portal Cache
Granular scope, depending on event
–
–
–
–
Entire Cache
All objects for a specified user
All instances of a specified object
Pages containing an invalidated portlet
Hard Invalidation Events
Clear entire cache
Clear cache for user
Clear cache for object
Click “Refresh” link on
page
Modify page properties
or layout
Modify item
Modify template or style
Modify provider
properties
Customize page or
portlet
Edit defaults on page or
portlet
Soft Invalidation Events
Delete user
Add user to group
Remove user from group
Add group to group
Remove group from group
Delete group
Change privilege on object in Repository
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Other Performance Factors
HTTP Server
Login Rate
Portlet Execution Speed
Page Complexity
Network Bandwidth
Load Distribution
Other Portal Activity
Hardware Resources
CPU Performance
Type of Content
SSL
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Date
31
/0
3/
20
03
29
/0
3/
20
03
30
/0
3/
20
03
27
/0
3/
20
03
28
/0
3/
20
03
25
/0
3/
20
03
26
/0
3/
20
03
Login Count
Unique Logins per Day
Unique Logins per Day
25000
20000
15000
10000
5000
0
Unique Logins per Hour
Unique Logins per Hour
1800
1600
1400
1000
800
600
400
200
Hour
22
:x
x
20
:x
x
18
:x
x
16
:x
x
14
:x
x
12
:x
x
10
:x
x
08
:x
x
06
:x
x
04
:x
x
02
:x
x
0
00
:x
x
Login Count
1200
25
/0
3/
20
03
26
/0
3/
20
03
27
/0
3/
20
03
28
/0
3/
20
03
29
/0
3/
20
03
30
/0
3/
20
03
31
/0
3/
20
03
01
/0
4/
20
03
Page Views
Page Views per Day
Page Views per Day
160000
140000
120000
100000
80000
60000
40000
20000
0
Date
Page Views & CPU Load
Page Views per Hour & CPU Load
20.00
14000
12000
10000
14.00
12.00
8000
10.00
6000
8.00
6.00
4000
4.00
2000
2.00
0.00
0
Time
Unique Page Views
16.00
00
:x
x
02
:x
x
04
:x
x
06
:x
x
08
:x
x
10
:x
x
12
:x
x
14
:x
x
16
:x
x
18
:x
x
20
:x
x
22
:x
x
Percent CPU Utilization
18.00
Page Views
Mid-Tier
Repos
Agenda
Why is Scalability Important for Portal
Deployment?
OracleAS Portal Page Generation
Architecture
Page and Portlet Caching
Other Performance Factors
Results
Conclusion
Conclusion
Key Success Factors for deploying an
enterprise portal to a large audience
–
–
–
Intelligent Caching
Scalable, Distributed, Cross-Platform
Architecture
Uniquely combined in OracleAS Portal
Understanding scalability features and the
page generation process will help you design
and build your enterprise portal
Next Steps….
Recommended sessions
–
–
–
–
40046 An Overview of Enterprise Portals: Today
and Tomorrow - Marco Tilli
40031 The New Enterprise Manager: End-to-end
Performance Management of Oracle Solutions
40051 Manage, Integrate and Publish your
Enterprise Content into Your Portal
40047 Collaborate on the same Portal page
Recommended demos and/or hands-on labs
–
Oracle Application Server Portal Hands-on lab
Next Steps….
See Your Business in Our Software
–
Visit the DEMOgrounds for a customized
architectural review, see a customized demo with
Solutions Factory, or receive a personalized
proposal. Visit the DEMOgrounds for more
information.
Relevant web sites to visit for more
information
–
–
http://portalcenter.oracle.com
http://otn.oracle.com/products/oem/content.html
QUESTIONS
ANSWERS
Reminder..
Please complete the
OracleWorld online session
survey
Thank you.
Session & Activity Guide
Sessions - ENTERPRISE PORTALS
• Design an Attractive and
Compelling Portal Interface
Monday, 4:00 PM Moscone 133
• An Overview of Enterprise
Portals: Today and Tomorrow
Tuesday, 11:00 AM Moscone 134
• Manage, Integrate, and
Publish Enterprise Content
into Your Portal
Tuesday, 8:30 AM Moscone 133
• Develop Java Portlets for
Your Portal
Tuesday, 5:00 PM Moscone 252
•Get Your Community to
Collaborate on the Same Portal
Page
Wednesday, 8:30 AM Moscone 252
•Integrate your Enterprise
Business Applications Into Your
Portal
Wednesday, 11:00 AM Moscone 252
•Tips and Techniques for
Deploying a Scalable Portal
Wednesday, 1:00 PM Moscone 302
•Administer and Monitor Your
Portal with Oracle Enterprise
Manager
Wednesday, 4:30 PM Moscone 302
Session & Activity Guide
Activities - ENTERPRISE PORTALS
•Hands On Labs
Monday, 10:30 AM – 5:00 PM
Tuesday, 8:30 AM – 12:30 PM
Tuesday, 3:00 PM – 5:00 PM
Tuesday, 6:30 PM – 10:00 PM
Wednesday, 8:30 AM – 4:30 PM
Thursday, 8:30 AM – 2:30 PM
Marriott Hotel - Golden Gate B2
•Oracle DEMOgrounds
Monday, 5:00 PM – 8:00 PM
Tuesday, 10:30 AM – 1:00 PM
Tuesday, 3:00 PM – 6:00 PM
Wednesday, 11:00 AM – 4:30 PM
Thursday, 10:30 AM – 2:00 PM
Show floor: Booth 1326 Oracle AS
•Meet the Portal Guru – Marco
Tilli
Tuesday, 3:30 PM
Guru Lounge
•Portal Partners
Oracle Application Server Partner
Pavilion
Booth 710