10
COMMON MISTAKES THAT AFFECT PERFORMANCE

Common mistakes for ATG applications that affect performance

Embed Size (px)

DESCRIPTION

Some tips for ATG Developers how to improve performance of the atg application and how to avoid typical mistakes

Citation preview

Page 1: Common mistakes for ATG applications that affect performance

COMMON MISTAKES THAT AFFECT PERFORMANCE

Page 2: Common mistakes for ATG applications that affect performance

PROBLEM: SITE IS TOO SLOW

Page 3: Common mistakes for ATG applications that affect performance

RES

ULT

: AN

GR

Y C

US

TO

MER

S

Page 4: Common mistakes for ATG applications that affect performance

HOW TO PREVENT PROBLEMS WITH PERFORMANCE?

Frontend

Server’s tuning

DB

Page 5: Common mistakes for ATG applications that affect performance

SERVER’S TUNING

Apache

Gzip• enable

mod_deflate.

Cache settings• ExpiresDefault

"access plus 1 month“

Static content

JBOSS

trimSpaces• it helps with

multiple blank lines

Page 6: Common mistakes for ATG applications that affect performance

TIPS: REPOSITORIES

1. Do not use XML or HTML repositories2. Configure repository item caching

Page 7: Common mistakes for ATG applications that affect performance

TIPS: QUERIES

Avoid SQLQueryForEach, SQLQueryRange and other non-cached database querying

Don’t use RQLQueryForEach if you have the Repository Id you want, just use the RepositoryLookup droplet.

It's better to do more difficult queries in spite of simple query and a lot of calculations on application size

Page 8: Common mistakes for ATG applications that affect performance

TIPS: TRANSACTIONS

Do not access repository items outside of a transaction

ATG Commerce Order object must follow a specific transactional pattern to avoid exceptions and deadlocks,  ConcurrentUpdateExceptions, InvalidVersionExceptions

1. Obtain local-lock on profile ID.2. Begin Transaction3. Synchronize on Order4. Perform ALL modifications to the order object.5. Call OrderManager.updateOrder.6. End Synchronization7. End Transaction.8. Release local-lock on profile ID.

Page 9: Common mistakes for ATG applications that affect performance

TIPS

The sortProperties parameter of *Range, *ForEach, and Targeting* servlet beans

a sortProperties parameter provides an easy way to sort items in an array.

Avoid retrieving large arrays of data just to show a few items: use the Range servlet bean to show only a few items in the current page

Example: Order History page

Page 10: Common mistakes for ATG applications that affect performance

TIPS: OTHERS

Verify that the PageFilter in web.xml is bound to the right extension. Typically it's *.jsp, not /*.

Pre-Compiling JSPs Recheck components scope Disable Performance Monitor Ensure that loggingDebug is disabled for all

components Disabling Document and Component

Indexing /atg/devtools/DocumentIndex.enabled=false and /atg/devtools/ComponentIndex.enabled=false