1.03k likes | 1.29k Views
Expert Tips and Tricks to Optimize the Performance of Your XPages Applications. Bruce Elgort Elguji Software. In This Session. Users expect that applications are fast and responsive Isn ’ t it funny how you only hear from them when they are slow and poorly designed
E N D
Expert Tips and Tricks to Optimize the Performance of Your XPages Applications Bruce Elgort Elguji Software
In This Session ... • Users expect that applications are fast and responsive • Isn’t it funny how you only hear from them when they are slow and poorly designed • XPages does all this for me, right? Nope. • XPages gives us a powerful set of development tools right out of the box, however … • They sometimes don’t perform as well as we had hoped • Or we used XPages when a classic Domino application could have done the trick • This session is designed to help developers optimize the performance of their XPages applications
What We’ll Cover … • Things to consider when moving applications to XPages • Understanding the JSF lifecycle and how it relates to XPages application design • Development best practices for performance and scalability • How to identify application bottlenecks using the OpenNTF XPages Toolbox • Third-party tools to help profile your applications performance • Wrap-up
XPages Application Design Considerations • When should you: • Migrate a Notes/Domino application to XPages? • Avoid developing/migrating applications to XPages? • Consider a “hybrid” approach?
Migrating an Application to XPages • Consider migrating an application to XPages if: • It’s an active application that brings value to the business • Functionality can be moved to the browser without much disruption and/or retraining • It is not required to be used offline • Notes “only” applications that now require Web browser access • The applications need a facelift and/or require new functionality
Avoid Using XPages • You may want to avoid using XPages if: • Notes encryption is required • The app depends on COM for calling other applications such as Word or Excel • Makes heavy use of rich text • Integration with calendaring and scheduling is required • You have stable complex applications that are mission-critical and running the business • You have applications that are better suited for a Notes client user experience
When to Consider a Hybrid Approach • A hybrid approach is one that utilizes classic Notes and Domino design elements, as well as ones developed using XPages • Consider a hybrid approach when: • You have Notes client apps that require Web browser and/or mobile support yet still require use of the Notes client • You need to add REST services, report generation, or other services using XPages “XAgents” • When you are first starting to learn XPages • When only a subset of features are needed from the Web and/or mobile device
What We’ll Cover … • Things to consider when moving applications to XPages • Understanding the JSF lifecycle and how it relates to XPages application design • Development best practices for performance and scalability • How to identify application bottlenecks using the OpenNTF XPages Toolbox • Third-party tools to help profile your applications performance • Wrap-up
Understanding the JSF Lifecycle • XPages is built on the JavaServer Faces framework • It is important to understand the principles of this framework • Stateful Web application architecture • Component-based architecture • Every tag has a server-side object representation • Saving and restoring state • Validation • Rendering the tags/markup to the client • Uses a six-phase life cycle that is extended by XPages
The 6 Phase JSF Request Processing Lifecycle • Restore View – Retrieves the JSF view for the request • Apply Request Values – Updates the JSF components to update their state based on values from the current request • Process Validations – Validators invoked • Update model values – Application data is updated with new values. Values are written to the Domino back-end document during this phase. • Invoke applications – Application logic executed • Render response – Generates the response and saves the state of the view
More on the JSF Lifecycle Phases and What They Do • Phases 1 and 6 are “system-level” phases • They are going to happen no matter what we do to our code • Phases 2, 3, 4, and 5 are “application-level phases” • These phases are something we as developers can use to our advantage • By understanding how we can tweak our XPages objects to make more efficient use of the JSF lifecycle • We will explore how your XPages can skip some of the six phases which in turn reduce CPU utilization processing and increase speed
The JSF Lifecycle www.ibm.com/developerworks/library/j-jsf2/
The Link Control and the JSF Lifecycle • Let’s start off by looking at the link control • The link control is used to place a hypertext link on an XPage or in a custom control • When you place the link control on your XPage and use a “simple action” to set the link you will see this in your XPage markup <a id="view:_id1:link1" href="#" class="xspLink">Link</a> • When you inspect what the browser is doing when the link is clicked you will see that the browser is issuing a “POST” request to the server • This is using phases 2-5 of the JSF lifecycle and is a more “expensive” operation • An extra trip is being made to the server to resolve the # in the link
The Link Control and the JSF Lifecycle (cont.) • Changing the simple action to a defined page in the link properties will now generate this code <a id="view:_id1:link1" href="/xpagesplay.nsf/contact.xsp" class="xspLink">Link</a> • This will eliminate the need for: • A round trip to the server (POST) is now bypassed as are phases 2-5 of the JSF lifecycle • Use direct links whenever possible • These will generate GET requests • Save CPU time • Generate a snappier user experience
What We’ll Cover … • Things to consider when moving applications to XPages • Understanding the JSF lifecycle and how it relates to XPages application design • Development best practices for performance and scalability • How to identify application bottlenecks using the OpenNTF XPages Toolbox • Third-party tools to help profile your applications performance • Wrap-up
The Read-Only Property • Setting the read-only property of a Panel in Domino Designer
The Read-Only Property (cont.) • Use Panel controls where no server-side JavaScript or simple actions are contained in the panel that don’t require processing • Panel controls generate HTML divs which are used to place other components within • Set this to true in the Properties panel • Other considerations: • The other thing you should consider is not using the Panel core control but rather an HTML div instead • This is also true for any other HTML element that doesn’t require any processing • Remember that only <xp:> tags are processed during the JSF lifecycle • Setting read-only to “true” skips JSF phases 2-5
The Immediate Property • This does not validate or update any data • No server validation will occur • No further processing of the XPages component tree will occur • Just do what I say “immediately” and Cancel! • Typically used on a Cancel button • Set the value to true <xp:button value="Cancel" id="button2"><xp:eventHandler event="onclick" submit="true" refreshMode="complete" save="false" immediate="true"></xp:eventHandler></xp:button> • Setting the immediate property to “true” skips JSF phases 3-5
The Immediate Property (cont.) • Here is our Cancel button in Domino Designer showing the “Do not validate or update data” option is checked • This sets the value to true in the XPage XML source
Partial Refresh • A radio button under a controls Server Options that allows you to select the target component that will be refreshed • Reduces the amount of HTML markup that must be processed and emitted • Less HTML and other elements means that the application is more responsive • The entire page does not have to be reloaded • Makes Phase 6 (Render response) of the JSF lifecycle very fast and efficient • Only the selected/component branch of the JSF tree is updated • There may be some side effects which will require you to force the entire tree to update
Partial Refresh (cont.) • If you want the server to always render the whole view tree you can: • Add xsp.ajax.renderwholetree=true to the xsp.properties • This file is in the WebContent/WEB-INF/ directory • Use Partial Refresh where ever possible so only that portion of the JSF tree is processed and not the entire component tree
The DataCache Property • Used for caching Domino view data • Persisted view data consumes JVM memory • Use if the view data isn’t needed in a POST request • Three values are supported for the DataCache property: • Full [default] • The entire view is persisted • ID • Minimal scalar data ID and position. Access to column values during a POST are not available. • None • Enough said – the entire view needs to be reconstructed
Partial Execution • Controls how much component tree processing happens during phases 2-5 of the JSF lifecycle • Partial Execution is purely a server-side optimization • Partial Refresh and Partial Execution are mutually exclusive and do not depend on each other in any way
Partial Execution (cont.) • Set the execMode property on server events using: • “Set partial execution mode” in the Server Settings section • The default is “complete” and when checked is set to “partial” • Very powerful when used inside of a View Panel, Data Table, or Repeat Control • Child controls can have this property set which will not cause the parent control to not be re-executed during invocation of a child event handler • Did I mention that this is very powerful and you should carefully review your code to ensure that you are taking advantage of Partial Execution wherever possible?
Exploring the XPages Request Processing Lifecycle • So how do you know when and where your code is executing in the JSF Lifecycle? • Couple this with Partial Refresh and Partial Execution of controls and things can become pretty complex exponentially. • IBM’s Tony McGuckin has posted code on the OpenNTF Xsnippets site that will help you learn more about the JSF lifecycle. It will also clearly show you which phase(s) of the lifecycle your code is being executed. • A sample XPage is included. http://openntf.org/XSnippets.nsf/snippet.xsp?id=xpages-request-processing-lifecycle-explorer-code...
The Sample XPage • The sample XPage that we are going to examine has: • The XPage view has the following event handlers defined: • beforePageLoad • afterPageLoad • afterRestoreView • beforeRenderResponse • afterRenderResponse • Each of these events has a print statement that will print out to the Domino console • Let’s look at the page design and them walk through some of examples
Sample Lifecycle XPage Layout Domino Designer Design View
Sample Lifecycle XPage Layout (cont.) Web browser view
LifeCycle.nsf Page Initial Load Output • All of the controls are rendered and then JSF Phase 6
P2 Button Clicked Output • Button P2’s onclick event is set to Partial Refresh of the P2 panel • Partial Execution Mode has also been selected with an execId of P2
P2 Immediate Button Clicked Output • Button P2’s click event is set to Partial Refresh of the P2 panel • Partial Execution Mode has also been selected and set to execId P2 • The immediate property of the button’s onclick event has been set which will bypass any validation • Typically used to save a document in draft form
P2 Button Disable Validators Clicked • Button P2’s click event is set to Partial Refresh of the P2 panel • Partial Execution Mode has also been selected and set to execId P2 • The “Process data without validation” checkbox is enabled (disableValidators=“true”). All phases are executed.
P1 Button Clicked • Button P1’s click event is set to Partial Refresh of the P1 panel • Partial Execution Mode has also been selected and set to execId P1 • Pretty much what we expected
P1 Button Immediate Clicked • Button P1’s click event is set to Partial Refresh of the P1 panel • Partial Execution Mode has also been selected and set to execId P1 • The immediate property of the button’s onclick event has been set which will bypass any validation
P1 Button Disable Validators Clicked • Button P1’s click event is set to Partial Refresh of the P1 panel • Partial Execution Mode has also been selected and set to execId P1 • The “Process data without validation” checkbox is enabled (disableValidators=“true”). All phases are executed.
P2 No ID Partial Execute/Full Refresh • 05/10/2012 08:46:14 AM HTTP JVM: Request: Started... • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 08:46:14 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 08:46:14 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:46:14 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 08:46:14 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 08:46:14 AM HTTP JVM: • 05/10/2012 08:46:14 AM HTTP JVM: Request: Completed.
P2 Full Execute/Partial Refresh • 05/10/2012 08:49:31 AM HTTP JVM: Request: Started... • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 08:49:31 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:49:31 AM HTTP JVM: Event: p2->partial refresh value: 123 • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 08:49:31 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 08:49:31 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:49:31 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 08:49:31 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 08:49:31 AM HTTP JVM: • 05/10/2012 08:49:31 AM HTTP JVM: Request: Completed.
P2 Partial Execute/Partial Refresh • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Request: Started... • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 08:50:53 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:50:53 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:50:53 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:50:53 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 08:50:53 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 08:50:53 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:50:53 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 08:50:53 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 08:50:53 AM HTTP JVM: • 05/10/2012 08:50:53 AM HTTP JVM: Request: Completed. • 05/10/2012 08:50:53 AM HTTP JVM:
P1 No ID Partial Execute/Full Refresh • 05/10/2012 08:55:07 AM HTTP JVM: Request: Started... • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 08:55:07 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:55:07 AM HTTP JVM: Event: no id->partial execute value: 123 • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 08:55:07 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 08:55:07 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:55:07 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:55:07 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:55:07 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 08:55:07 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 08:55:07 AM HTTP JVM: • 05/10/2012 08:55:07 AM HTTP JVM: Request: Completed.
P1 No ID Full Execute/Partial Refresh • 05/10/2012 08:56:40 AM HTTP JVM: Request: Started... • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 08:56:40 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 08:56:40 AM HTTP JVM: Event: no id->partial refresh value: 123 • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5
P1 No ID Full Execute/Partial Refresh (cont.) • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 08:56:40 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 08:56:40 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 08:56:40 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 08:56:40 AM HTTP JVM: • 05/10/2012 08:56:40 AM HTTP JVM: Request: Completed.
P1 No ID Partial Execute/Partial Refresh • 05/10/2012 09:00:19 AM Finished replication with server NA1/ideaExchange • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Request: Started... • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: Before Phase: RESTORE_VIEW 1 • 05/10/2012 09:00:21 AM HTTP JVM: Page: view1->afterRestoreView • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: After Phase: RESTORE_VIEW 1 • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: Before Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: After Phase: APPLY_REQUEST_VALUES 2 • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: Before Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: After Phase: PROCESS_VALIDATIONS 3 • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: Before Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: After Phase: UPDATE_MODEL_VALUES 4 • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: Before Phase: INVOKE_APPLICATION 5 • 05/10/2012 09:00:21 AM HTTP JVM: Event: no id->partial refresh/execute value: 123 • 05/10/2012 09:00:21 AM HTTP JVM: Lifecycle: After Phase: INVOKE_APPLICATION 5 • 05/10/2012 09:00:21 AM HTTP JVM: • 05/10/2012 09:00:22 AM HTTP JVM: • 05/10/2012 09:00:22 AM HTTP JVM: Lifecycle: Before Phase: RENDER_RESPONSE 6 • 05/10/2012 09:00:22 AM HTTP JVM: Page: view1->beforeRenderResponse • 05/10/2012 09:00:22 AM HTTP JVM: Control: txt1->rendered • 05/10/2012 09:00:22 AM HTTP JVM: Control: txt2->rendered • 05/10/2012 09:00:22 AM HTTP JVM: Control: txt3->rendered • 05/10/2012 09:00:22 AM HTTP JVM: Page: view1->afterRenderResponse • 05/10/2012 09:00:22 AM HTTP JVM: Lifecycle: After Phase: RENDER_RESPONSE 6 • 05/10/2012 09:00:22 AM HTTP JVM: • 05/10/2012 09:00:22 AM HTTP JVM: Request: Completed.
New in Domino 8.5.3 • Use runtime optimized JavaScript and CSS resources
New in Domino 8.5.3 (cont.) • Before and after
New in Domino 8.5.3 (cont.) • Pre-load XPage engine to improve startup times – XPagesPreload=1 in notes.ini • You can now “pre-load” XPages Java code into memory • This makes your apps more responsive on first use • In your notes.ini file you can specify which databases to pre-load: • XPagesPreloadDB=servername!!path/mydb.nsf/myxpage.xsp,servername!!path/anotherdb.nsf
Single Copy XPage Design (SCXD) • New with Domino 8.5.2 www-10.lotus.com/ldd/ddwiki.nsf/dx/Single_Copy_XPage_Design
Single Copy XPage Design (SCXD) (cont.) • Allows lots of applications using the same template to share XPage code • Saves loading more XPages into server memory • Good example is the Discussion template • Another example is from XPages developer Declan Lynch who has 96,000 databases which share the same design thus saving approximately 6mb per database (that’s 562gb!) • You will need to restart HTTP in order for new design changes to be picked up by databases relying on your SCXD database A note on SCXD (Single Copy XPage Design), IBM fixed a high severity 8.5.3 bug (PHAN8N3HZ9) where the SCXD would timeout causing an exception under a certain scenario. This fix will be available in FP1. A Hot fix is also available.
Quick Performance Hits • Give the server lots and lots and lots of RAM. And then some more. Rinse and repeat. • Use a 64-bit OS whenever possible • Devote fast disk or SSD to your servers’program files volume – This is where the XPages code is called from • Isolate heavily used XPages apps, especially from other memory intensive apps such as Traveler • Consider dedicated Domino instances for large applications
Setting the Data Scope for a View • When you add data sources to your XPage, each one has a “scope” • It’s set under All Properties in the XPage • Data, name, scope • The default is “viewScope” • Data is stored as part of the page • If you want to cut down on as much memory usage as possible, and you are not relying on pass through parameters like a filter or a search • Set the value of scope to “request”
Let’s Get Synchronized • Every bit of performance we can gain is a good thing for the person using our XPages applications • Many applications have several commonly used pieces of code that get executed over and over again • An example would be an application that has a “control panel” type of interface • This interface allows you to configure and enable/disable features and functions in the application • Having your application constantly calling the same code over and over again is not efficient • There is a better way to handle these types of situations • Synchronize to the rescue …