+ All Categories
Home > Documents > We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

Date post: 22-Nov-2014
Category:
Upload: we4it-group
View: 1,613 times
Download: 1 times
Share this document with a friend
Description:
 
59
© 2013 IBM Corporation AD208 IBM Domino® XPages Performance in a Nutshell Originally presented by: Maire Kehoe | Advisory Software Engineer Tony McGuckin | Software Engineer Presented today by: Matthew Fyleman | Product / Project Manager - We4IT
Transcript
Page 1: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

© 2013 IBM Corporation

AD208 IBM Domino® XPages Performance in a NutshellOriginally presented by:Maire Kehoe | Advisory Software EngineerTony McGuckin | Software Engineer

Presented today by:Matthew Fyleman | Product / Project Manager - We4IT

Page 2: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

2 © 2013 IBM Corporation

Please note:

IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 3: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

3 © 2013 IBM Corporation

Welcome and Introductions

Maire Kehoe─ Advisory Software Engineer: IBM Ireland

– IBM Lotus® Domino XPages– IBM Lotus® Component Designer 6.0– XPages Runtime SME, XPages TeamRoom, ExtLib– Joined IBM 2003

Author─ XPages Portable Command Guide

Page 4: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

4 © 2013 IBM Corporation

Welcome and Introductions

Tony McGuckin─ Senior Software Engineer: IBM Ireland

– XPages Runtime SME– Product & Application Template Development– Customer Enablement & Proof-of-Concept Development– Co-creator of global XPages@... Workshops– Lotus OneUI Adoption Workgroup

Author─ Mastering XPages─ XPages Portable Command Guide

Page 5: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

5 © 2013 IBM Corporation

Outline XPages Architecture & Overview of a request

─ Environment – Domino HTTP server, OSGi plugins, loading NSF design elements─ JSF & XPages control tree & lifecycle─ Backend calls to get data sets

The Tools ─ for finding and understanding performance problems

AppDev choices─ Most problems we're seeing in production applications are AppDev issues – in the Application

Development and the XPage design

Configuration options─ And discuss the different types of performance issues they solve

Shared Design & XPiNC considerations─ Sharing design between applications, and XPiNC being XPages in the Notes® Client

Page 6: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

6 © 2013 IBM Corporation

XPages Architecture & Overview of an XPage request

Page 7: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

7 © 2013 IBM Corporation

What is XPages?

The Notes/Domino App Dev Solution for Modern Web Applications Standards-based Web 2.0 rapid application development framework

─ Uses JavaServer Faces (JSF)/JavaScript on server side─ Uses HTML/JavaScript/Dojo(TM) on the client side

Java and OSGi-based runtime ─ fully integrated into Domino server, Notes client, IBM XWork server

Component-based portable development model (write-once-run-anywhere) Set of design elements in Domino Designer Provides built-in Domino data sources

─ Out-of-the-box data sources for binding to Domino views and documents─ Efficiently manages hierarchies of documents, seamlessly handles data model changes

Highly extensible and customizable ─ Enables customers/business partners to build their own components, controls, data sources etc─ e.g. XPages Social Enabler, XPages RBMS integration

Page 8: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

8 © 2013 IBM Corporation

What is an XPage?

A Domino design element, just like the traditional form or view A page of XML tags known as XSP markup Can be an aggregation of other mini-XSP files known as Custom Controls Each XSP tag represents a design artifact … e.g. controls

─ UI Control: like a simple button, link, or as complex as a calendar─ Data Source: a mechanism that fetches data from a particular source for display in a control─ Event Handler: custom logic that “handles” events on a page, typically done in JavaScript─ Simple Action: a high level piece of executable logic, like Open a Page, Save a Document

Page 9: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

9 © 2013 IBM Corporation

What is an XPage?

XSP Markup – XML + HTMLXSP/JSF Hierarchy of

Components

HTML in a browser

Page 10: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

10 © 2013 IBM Corporation

XPages Architecture

Domino HTTP Server

Client Request

2.4 servlet engine

NSF database containing the design elements & the data

XPages Servlet Engine

The server directly reads the design elements from the NSF database

Virtual J2EE modulesNo WAR deploymentrequired

Page 11: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

11 © 2013 IBM Corporation

XPages Architecture – 8.5.2++

The XPages runtime is deployed as a set of OSGi bundles (plugins/jars)Extensions: within an NSF Application, or as separate XPages Extension bundles

─ XPages Open Source Libraries [ExtLib] (8.5.3UP1 | OpenNTF.org) (likely in N/D Next)─ XPages Experimental Extensions [ExtLibX] (OpenNTF.org) (not in N/D)─ 3rd party XPages extensions & use of 3rd party plugins (Apache, JDBC etc.)

Domino HTTP Task

OSGi Runtime

XPagesRuntime

NSF Applications

XPages ExtensionsOSGi bundles

Notes Client Process

OSGi Runtime

XPagesRuntime

XPD Profile+Web Container

XPD Profile

Domino Server Notes Client

NSF Applications

XPages ExtensionsOSGi bundles

Page 12: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

12 © 2013 IBM Corporation

XPages extends JavaServer Faces Framework (JSF 1.1)

The XPages Request Processing Lifecycle Phases 1. Restore View – Retrieves the JSF view for the request 2. Apply Request Values – Updates the JSF components to update their state

based on values from the current request 3. Process Validations – Convertors and/or Validators invoked 4. Update model values – Application data is updated with new values. Values

are written to the Domino back-end document during this phase. 5. Invoke applications – Application logic executed 6. Render response – Generates the response and saves the state of the view

Page 13: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

13 © 2013 IBM Corporation

XPages extends JavaServer Faces Framework (JSF 1.1)

http://www.ibm.com/developerworks/java/library/j-jsf2/

Page 14: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

14 © 2013 IBM Corporation

A Request

Page 15: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

15 © 2013 IBM Corporation

Tools for performance

Page 16: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

16 © 2013 IBM Corporation

XPages Toolbox v1.2

XPages based Application─ Runs on the Domino server or the Notes client─ An NSF needs to be installed on the Domino server/Notes client─ A profiler jar file should be added to the JVM launch options

Measures the CPU performance and the memory allocation Published on OpenNTF.org

─ Open source project─ http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages

%20Toolbox Extended in 8.5.2 to support Backend classes profiling

Page 17: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

17 © 2013 IBM Corporation

XPages Toolbox v1.2

CPU Profiler

Memory Profiler

Page 18: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

18 © 2013 IBM Corporation

Heap Dumps - XPages Toolbox v1.2 Generate a heap dump of the JVM running in the HTTP task

─ A button in the XPages profiler generates the heap dump─ A command from the Domino console [added 8.5.3]

– tell http xsp heapdump (triggers com.ibm.jvm.Dump.HeapDump())– tell http xsp javadump (triggers com.ibm.jvm.Dump.JavaDump())

Analyze the heap dump using the Eclipse Memory Analyzer─ http://www.eclipse.org/mat/─ and the related extension for IBM JVMs:

IBM Diagnostic Tool Framework for Java Version 1.10 extension

Heap dumps occur in production─ when XPage(s) fail due to a

java.lang.OutOfMemoryError

Page 19: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

19 © 2013 IBM Corporation

More Tools Print statements

─ In rendered/visible computations to see how often executed– print("panel2 evaluating rendered property");

─ In the XPages root control events: before/afterPageLoad, afterRestoreView, before/afterRenderResponse. Custom control root events: before/afterPageLoad.

─ In the document data source events: queryNewDocument, postSaveDocument, etc.– “post” means after, “query” means before and return true/false to do New/Open/Save

Task Manager and/or Process Explorer─ Shows CPU usage & process memory usage as it happens─ Heap memory usage will be a subset of process memory, but heap dumps are only a snapshot

Browser developer tools ─ for watching network transactions, partial updates, response times─ Firefox(TM) – Firebug add-on. Internet Explorer(TM) – menu Tools, Developer Tools.─ XPiNC – equivalent to Firefox 3.6.1, also in xsp.properties, find and enable: isDebug:true

Java Debugging─ Degrades performance but can inspect objects, step into code. Use the Eclipse Java debugger.─ In Domino\notes.ini add these 2 options: JavaEnableDebug=1─ JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000

Page 20: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

20 © 2013 IBM Corporation

AppDev Choices for performance

Page 21: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

21 © 2013 IBM Corporation

AppDev XPage design optimizations

Open Page simple action vs links or button with window.location JS Reducing server phase processing

─ Use partial update where possible─ Use partial execute where possible─ Use disableValidators & immediate event

Minimizing work in rendered / visible computations Repeats & views

─ Using viewEntry.getColumnValue instead of viewEntry.getDocument.getColumn─ Use Domino View data source dataCache property where possible & scope property

Load-time vs Runtime─ Using loaded vs rendered and other load-time optimizations─ ExtLib Dynamic Content – allows partial re-loading so more use of load-time optimizations

Loading resources in the browser─ CSS & browser JS – extract to separate files. Minify & compress files─ Images – use correct size & format. Use CSS Image Sprites as possible

Page 22: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

22 © 2013 IBM Corporation

Using GET requests - Links & browser location redirect Instead of Open Page simple action, use links or Browser Script to redirect:

<xp:link text="Open" id="link1"> <xp:this.value><![CDATA[#{javascript: "/topicThread.xsp?documentId=" + rowData.getUniversalID() + "&action=editDocument"}]]></xp:this.value></xp:link><xp:button value="Edit" id="button1"> <xp:eventHandler event="onclick" submit="false"> <xp:this.script><![CDATA[window.location.href = "/topicThread.xsp?documentId=" + "#{javascript:rowData.getUniversalID()}" + "&action=editDocument"; ]]> </xp:this.script></xp:eventHandler></xp:button>

Pros: Fewer browser round-trips, less server processing

─ Open Page simple action means a submit & lifecycle before redirect to the new page

Cons: Not always possible – e.g. if need Save Document before Open Page

─ Or any server-side action or script needs to execute before moving to the new page

Page 23: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

23 © 2013 IBM Corporation

Full lifecycle─ Most phases of the lifecycle iterate through the server-side control tree

Page 24: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

24 © 2013 IBM Corporation

Partial Update─ Partial Update reduces the last phase: refreshMode="partial" refreshId="panel2"

Page 25: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

25 © 2013 IBM Corporation

Partial Update

Pros: Reduced control processing in the render response phase

─ Means less work on the server - render response is the most intensive phase Reduced network usage – smaller response from server. Better browser experience

─ rest of the page is still visible while waiting for a response─ inserting small sections into the page is much faster than reloading a full page.

Cons: Dependancy on computations outside of the partial update area

─ Other areas of the control tree are not processed,so any SSJS scripts in those other controls will not be run,so enabling Partial Update where it was previously full update may lead to functional problems where expected changes did not occur, or some state is out-of date.

Only one area may be partial updated by default─ In browser JavaScript you can schedule later partial updates of related areas,

but any concurrent requests will wait for exclusive access to the server-side control tree before processing on the server.

Page 26: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

26 © 2013 IBM Corporation

Partial Execution─ Partial Exec reduces the 3 data processing phases: execMode="partial" execId="panel2"

Page 27: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

27 © 2013 IBM Corporation

Partial Execution

Pros: Reduced control processing in the 3 data-processing phases

─ Means less work on the server, faster response times

Cons: Dependancy on Edit Box values outside of the partial exec area

─ Submitted values from Edit Boxes and/or other input controls in other areas of the control tree are not processed, so any control values and document fields in those other areas will not be updated. Enabling Partial Exec where it was previously full execution may lead to functional problems where values are out-of date in the onclick script or in the redisplayed page.

onclick Event Handler must be in the partial exec area─ The applyRequestValues phase prepares for the invokeApplication phase.

The onclick simple action or SSJS script won't occur if outside the partial exec area execMode only added in 8.5.1 (not in 8.5.0) execId slightly difficult to select in Designer

─ Select your button, in the Outline view, toggle open the button, select the child Event Handler control, then set the execId property on the Event Handler.

─ [Better UI proposed in Notes/Domino Next – in the Events tab]

Page 28: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

28 © 2013 IBM Corporation

Both - Partial Update & Execution─ Can combine partial update and partial execute: often exec and update the same area

or exec a smaller area containing just the Event Handler or Event Handler and some inputs

Page 29: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

29 © 2013 IBM Corporation

disableValidators & immediate─ For when you need a server-side action, but don't want the usual Data Processing

disableValidators─ 3 Data Processing Phases are same as usual, except each EditBox validator will do nothing─ Converters are still applied, document fields are updated without validation

Immediate─ applyRequestValues phase is combined with invokeApplication phase.

─ No other Data processing phases. Document fields not updated. ─ Event Handler onclick scripts and renderResponse phase computed values

will tend to see out-of-date values. To see up-to-date but not-converted values use:var editBox1 = getComponent('editBox1'); var value = editBox1.getSubmittedValue(); if( null == value ) value = editBox1.getValue();

Page 30: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

30 © 2013 IBM Corporation

Minimizing work in rendered / visible computations

The rendered property is computed in all 5 lifecycle phases─ Most properties, like CSS “style” are only computed in the renderResponse─ Edit Box and input “value” properties are used in Data Processing phases & renderResponse─ Data Source properties are computed during renderResponse

& results are cached for the next request's Data Processing & invokeApplication phases Avoid re-computing performance-heavy values in every rendered property

─ e.g. @DbLookup, @DbColumn, getDocumentByKey─ In the rendered property, save the computed boolean to a viewScope variable

if( !viewScope.computedDisplayPanel2 ){ // should compute viewScope.isDisplayPanel2 = @DbLookup(...).contains("unread"); viewScope.computedDisplayPanel2 = true;}return viewScope.isDisplayPanel2;

─ Subsequent re-computing of rendered will not enter the “if” statement, and will complete quickly─ If the computation depends only on user session information, save to sessionScope─ If the computation depends on a value in a comboBox,

remove the viewScope boolean in the comboBox onchange event

Page 31: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

31 © 2013 IBM Corporation

Avoid viewEntry.getDocument() in large repeats

viewEntry.getDocument() is a non-trivial─ The API viewEntry.getDocument() is a call to the backend classes─ Avoid calling it frequently, similar to avoiding @DbLookup in the rendered property─ It should only be used for very small data-sets─ It can easily cause performance delays when called repeatedly in 100s of rows

Use viewEntry.getColumnValue instead.─ If the value you need isn't an existing column value of the view,─ Consider defining a new view that has all the column values you need

In general, avoid complicated or slow operations in repeats─ Even relatively benign operations can cause problems when repeated frequently─ If you need to save row-related values to a viewScope variable,

use this rowId in the variable name:var rowId = getComponent("viewPanel1").getDataModel().getRowId();

─ in Domino views it's the NoteID, but the API is designed to work with non-Domino rows too

Page 32: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

32 © 2013 IBM Corporation

dataCache = full or id

The Domino View data source by default saves all view entry column values─ They are computed in the render response Phase, saved & restored between requests

and reused in the subsequent request's Data Processing Phases and invokeApplication phase Advantages:

─ to allow onclick events in repeat rows to use viewEntry.getColumnValue and still be reliable when rows have been deleted by other users between browser requests.

─ getColumnValue is useful with View Panel checkboxes for selected rows Disadvantages:

─ For large data sets, it takes a lot of work to save and restore all the viewEntries─ That may cause delays, and requests will wait longer before displaying in the browser─ The viewEntries use a lot of memory, which may contribute to OutOfMemoryError failures─ Not needed usually, except in the case mentioned.

Instead of saving all state use:<xp:dominoView dataCache="id" ... />

Page 33: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

33 © 2013 IBM Corporation

Using loaded vs rendered and other load-time optimizations Compute the loaded property on conditions

─ where you could compute the rendered property and save it to the view scope─ it would never need to be recomputed for the rest of the interaction with this page─ you don't need access to a repeat's rowData or viewEntry,

or to any control's clientId: #{id:inputText1} Loaded

─ is only computed once in the createView phase – not re-computed in the 5 usual phases─ false means the control is not created. So it can never be rendered.─ true means the control is added to the control tree.

You can still compute rendered when loaded evaluates to true. During the createView phase, things are different

─ Repeat controls do not repeat, so viewEntry objects are not available─ ClientIds may evaluate to values that will change in subsequent requests─ Scripts can't access controls in the control tree─ When in repeat controls, Custom Control “compositeData” property values are unreliable

Same for “Compute On Page Load” vs “Compute Dynamically” computed values before/afterPageLoad events are also during the createView phase

Page 34: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

34 © 2013 IBM Corporation

ExtLib Dynamic Content Allows partial re-loading of part of an XPage in response to an event

─ so the loaded property is no longer restricted to calculations depending on values that are the same for the duration of this XPage

─ Allows more use of load-time optimizations─ Still avoid re-evaluating during rendered evaluations─ Loaded is only evaluated during the initial page load

and during any events that trigger a reload of this section of the XPage Also allows choosing between child/facet areas to load

─ Both at initial page load, and─ Changing which child/facet area is loaded in response to an event

Other ExtLib controls are dynamic-enabled─ ExtLib Tab Container control can load new tabs and content in response to an event─ ExtLib Dialog control can load content just before the dialog is displayed,

so not taking up memory on the server until needed. The ExtLib set of controls are available

─ part of the released 8.5.3 UpgradePack1─ on OpenNTF.org – also has the ExtLibX controls (including the experimental JDBC support)─ planned to be included in Notes/Domino Next (present in the public Beta)

Page 35: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

35 © 2013 IBM Corporation

Loading Resources in the browser

For better performance in the browser.─ for your resources (CSS files, images and browser JavaScript files), you want─ Fewer requests to the server─ Smaller files retrieved from the server (less bandwidth)

Use the browser's cache where possible ─ use the same URLs to reference the same server files

Inline JavaScript in a web page executes inline ─ as the page is being displayed, blocking the display of the rest of the page to the user─ Use XSP.addOnLoad blocks to defer execution of scripts until after the initial inline load

Browsers have limits on the number of concurrent network requests─ Keeping it down to fewer files really matters

Page 36: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

36 © 2013 IBM Corporation

CSS & browser JS Move inline CSS and browser JS to separate files

─ Extract CSS and browser JavaScript from inline in the HTML outputto separate files (.css and .js),

─ to keep the HTML file size down─ to allow browser caching of the CSS and JS files─ Avoids repeating complicated CSS & JS snippets at multiple locations in the HTML

Minify & compress CSS and JS files.─ There are Dojo Toolkit build tools to minify.─ In CSS files, removes whitespace and comments.─ In JavaScript files, minify will also rename variables to shorter names.─ Save zipped/compressed .gz copies of server-wide .css and .js files─ the Domino HTTP server will serve the smaller .gz files to most browsers

(older browsers don't support the feature) Since 8.5.3, use the XPages aggregate option in the Application Properties

─ Appends CSS files together, for server-wide files, and separately for application-specific files─ Is aware of Dojo Modules, so can aggregate JS files that refer to other Dojo module .js files,

and XPage Dojo Module resource references that would appear in the HTML <head> tag.

Page 37: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

37 © 2013 IBM Corporation

Images

Use correct file type depending on content─ JPEG for complexed detailed images─ PNG/GIF for simple images, fonts, transparencies

Use the HTML <img tag “width” and “height” attributes─ For faster HTML layout in the browser

Size the image to size you intend to use─ Resizing using html attributes height and width will delay the rendering of your page─ Images larger than necessary will waste bandwidth

Use CSS Image Sprites─ If you have multiple small images, make a single larger image containing the smaller images─ And use CSS to display just the relevant subset image at a <SPAN location in the page─ For semantically significant sprites, provide an accessibility “title” attribute

(as sprites don't use the IMG “alt” attribute, but you still want to assist blind users)─ There's no specific XPages support for sprites, but they're used in the XPages OneIU themes

Page 38: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

38 © 2013 IBM Corporation

Configuration Options

Page 39: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

39 © 2013 IBM Corporation

Configuration Options - General Performance optionsnotes.ini HTTPJVMMaxHeapSizeSet=1 HTTPJVMMaxHeapSize=256M

─ The JavaTM memory allocation for the HTTP task─ For servers using XPages use 256MB on 32bit machines, 1024MB on 64bit machines.

JavaEnableDebug=1 JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000 JavascriptEnableDebug=1 (in Notes/Domino Next)

─ Debug has a performance degradation XPagesPreload=1 XPagesPreloadDB=teamdisc.nsf/ByAuthor.xsp

─ Will be covered in the XPiNC section, though also applies to the server

Domino Administrator HTTP server "Enable logging to" disabled HTTP server thread count – defaults to 40.

Page 40: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

40 © 2013 IBM Corporation

Configuration Options - xsp.propertiesDocumented in Domino\data\properties\xsp.properties.sample

xsp.persistence.mode─ Relates to OutOfMemoryError and server-side control tree caching. Also the related options:─ xsp.persistence.file.maxviews, xsp.persistence.file.gzip, xsp.persistence.file.threshold,

xsp.persistence.dir.xspstate

xsp.application.timeout=30min xsp.session.timeout=30min

─ Server timeouts ibm.jscript.cachesize

─ Server-side JavaScript expression cache xsp.resources.aggregate

─ Fewer requests for CSS and JS files, aggregated files are cached in server & browser xsp.compress.mode=gzip

─ Network files are smaller (enabled by default) xsp.expires.global=10days

─ Browser expiration for CSS & JS global files [global == not in application]

Page 41: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

41 © 2013 IBM Corporation

Shared Design + XPages in the Notes Client

Page 42: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

42 © 2013 IBM Corporation

Shared Design and some XPiNC issues & optimizations

Notes has the feature “Single copy template”─ Enable in a template, causes applications that will inherit from this template to include pointers

or reference notes to this template's design elements, rather than including copies of the design elements themselves.

─ Keeps the NSF file size down, XPages runtime memory size uneffected – still loads the design elements into memory again for each application that uses the design elements.

XPages has the feature “Single copy XPage design”─ And the corresponding “XPage design store path”. Both added in 8.5.2.─ Multiple applications point to a common nsf (not ntf)─ Browser URLs will use the shared XPages css, images,

browser JavaScript, giving browser caching.─ XPages runtime server code will mostly share the same

J2EE module – shared classloader, design elements loaded once, instead of per-application, etc.

─ App still behaves as a separate instance for:database object, applicationScope, sessionScope

─ Classic design elements (Views, Form, Agents...) are not shared

─ http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Single_Copy_XPage_Design

Page 43: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

43 © 2013 IBM Corporation

Page 44: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

44 © 2013 IBM Corporation

Single copy XPage design

HTTPServer

.xsp

.css & .gif

.xsp

User browser

User browser

.css & .gif

discussion1.nsf

sharedDiscuss.nsf

discussion2.nsf

Page 45: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

45 © 2013 IBM Corporation

XPages Preload Notes.ini option, new in 8.5.3

─ XPagesPreload=1─ XPagesPreloadDB=myServer!!myDb.nsf/myXPage.xsp,myLocalDb.nsf/test.xsp

After restart, the first time an application is used, there's a delay─ The first user to open an XPage in the application will have to wait while the OSGi plugins are

loaded and the XPages runtime platform-wide settings are read, the XPage.class file is read from the NSF, etc.

Preload will load the XPages runtime OSGi plugins PreloadDB will “fake” a request to the listed XPages

─ So that the initialization happens during the preload, just after startup, instead of during the first browser request for the application.

─ [It only loads the XPage itself, doesn't follow redirects or load CSS files, etc.] Preload in XPiNC

─ The “!!” syntax is used in XPages in the Notes Client (XPiNC)for loading remote applications, as opposed to local applications / local replicas.

─ Preload is especially useful with XPiNC remote apps, because the delay of fetching Design Elements and class files across the network is muchslower than the server delay of reading them from the server file system.

─ Admins can push the notes.ini setting out to all Notes clients

Page 46: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

46 © 2013 IBM Corporation

Cold Start

memory File System

OSGi & XPages runtime

HTTP server

Request

time

NSF class files & design elements

NSF data

memory File System

memory File System

Response

Page 47: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

47 © 2013 IBM Corporation

Warm Start

memory

OSGi & XPages runtime

HTTP server

Request

time

NSF class files & design elements

NSF data

memory File System

Response

memory

Page 48: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

48 © 2013 IBM Corporation

XPiNC optimizations

You can combine both “Single copy XPage design” and “XPagesPreload”─ However there were some issues when combining them in XPiNC

in the 8.5.3 GA release, fixed in 8.5.3FixPack3. XPiNC issues waiting for network traffic

─ Network traffic can be grossly inflated by sub-optimal app design practices, e.g.– A computeWithForm prop on a Domino doc data source will pull the Form across the net– A Form element is arbitrarily large, e.g. includes all subforms and any other contained

elements – each fetched individually.─ Inefficient data access operations, e.g.

– Opening documents on-the-fly within a data iterator / repeat control– Performing dynamic remote NSF lookups when computing “rendered” property values

─ Performance degrades even further on high latency networks─ Worse case

– There was a reported “perfect storm” app having 8minute delay on first opening in XPiNC– Optimize the application to reduce the usual AppDev issues (worse in XPiNC) down to 2min– Use XPagesPreload, no longer noticeable

─ There are proposed Notes/Domino Next options to improve the XPiNC behavior on slow networks for some scenarios

Page 49: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

49 © 2013 IBM Corporation

XPiNC Cold Start

memory Local File System

OSGi & XPages runtime

Local HTTP server

XPiNCbrowserRequest time

NSF class files & design elements

NSF data

Response

memoryServer File

System Network

memoryServer File

System Network

Page 50: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

50 © 2013 IBM Corporation

Ending & related

Page 51: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

51 © 2013 IBM Corporation

Before You Leave

Please complete your session survey

Session ID:AD208

Session Title:“IBM Domino XPages Performance in a Nutshell”

Page 52: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

52 © 2013 IBM Corporation

Q & A

Contact Information:[email protected]

[email protected]

Page 53: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

53 © 2013 IBM Corporation

XPages Portable Command Guide– Book Signing – Wednesday – 2:30-3:30pm

Tuesday─ 01-30pm AD206 IBM Lotus Domino XPages: Embrace, Extend, Integrate.

N Heidloff, P Edwards

─ 03-30pm AD203 IBM Domino Designer: Tips and Tricks for Maximum Productivity. K Howard, D O'Connor

Wednesday ─ 01-30pm AD204 How To Develop Great Applications Using XPages Design Patterns.

M Donnelley, T McGuckin─ 03-00pm AD215 Let it Flow: XPages are Workflow's New Best Friend. Q Liang, S Wissel─ 04-15pm AD205 Successfully Delivering XPages Projects - All Things Considered.

M Donnelly, T McGuckin, P Edwards─ 04-15pm AD202 Debug Server Side Javascript, Java, and XPages Apps Using the SSJS Debugger.

M Blout, D O'Connor

(Was Sunday) 08-00am JMP401 Master Class: XPages Performance - Inside Out. T McGuckin, M Kehoe

Page 54: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

54 © 2013 IBM Corporation

More Information XPages.info – One Stop Shopping for XPages

─ http://xpages.info

XPages Forum – Got Questions, Need Answers?

─ http://xpages.info/forum

OpenNTF – Open Source Community

─ http://www.openntf.org

Domino Application Development Wiki

─ http://www.lotus.com/ldd/ddwiki.nsf

XPages Blog

─ http://xpagesblog.com

IBM Educational Offerings

─ http://www.ibm.com/software/lotus/training/n8deducationofferings.html

Page 55: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

55 © 2013 IBM Corporation

Technical Education & Certification IBM Education XPages Courses

Learning Roadmaps (New Developers)

─ New Developers─ Experienced Developers

IBM Resells TLCC XPages Courses (and Other App Dev & Admin Courses)

New XPages Certification: Developing IBM Lotus Domino 8.5.2 Applications: Advanced XPage Design

Course Name

Fundamentals of IBM Lotus Domino 8.5.1 Application Development

Introduction to IBM Lotus Domino 8.5 XPages

Developing IBM Lotus Domino 8.5.2 Applications: Intermediate XPage Design

Developing IBM Lotus Domino 8.5.2 Applications: Advanced XPage Design (New 6/11)

Modernizing Domino Applications (New 8/11)

Page 56: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

56 © 2013 IBM Corporation

Mastering XPages Factoids...

─ Comprehensive 7 Part, 785 page volume─ IBM Press publication─ Authored by lead members of XPages development team─ Features contributions from other key community members─ Covers all aspects of XPages application development─ Example-driven approach focusing on practical problems─ Includes sample NSF downloads

Available now @ IBM Connect bookstore

Available online

─ www.ibmpressbooks.com/bookstore/product.asp?isbn=0132486482─ www.amazon.com/Mastering-XPages-Step-Step-Application/dp/0132486318

Page 57: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

57 © 2013 IBM Corporation

XPages Portable Command Guide Factoids...

─ Compact 320 page volume─ IBM Press publication─ Authored by members of XPages & Domino Designer dev teams─ Perfect complement to the popular Mastering XPages book,

helping experienced XPages developers go even further─ Thoroughly covers XSP properties, Command Manager

instructions, INI variables, OSGi console commands,debugging, logging and more.

─ Dozens of practical examples providing immediate solutions

Available now @ IBM Connect bookstore

Available online:

─ www.ibmpressbooks.com/bookstore/product.asp?isbn=0132943050─ www.amazon.com/XPages-Portable-Command-Guide/dp/0132943050

Page 58: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

58 © 2013 IBM Corporation

XPages Extension Library Factoids...

─ Comprehensive 600 page volume─ IBM Press publication─ Authored by a team of all-star XPages experts,

Featuring contributions from key community members─ Take full advantage of the XPages Extensibility

Framework, Library & API─ Step-by-step guide for developers of all experience levels─ Combines reference material and practical use cases

Available now @ IBM Connect bookstore

Available online:

─ www.ibmpressbooks.com/bookstore/product.asp?isbn=0132901811─ www.amazon.com/XPages-Extension-Library/dp/0132901811

Page 59: We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell

59 © 2013 IBM Corporation

Legal disclaimer

© IBM Corporation 2013. All Rights Reserved.The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.


Recommended