Upload
kate-semizhon-soglaeva
View
782
Download
0
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
COMMON MISTAKES THAT AFFECT PERFORMANCE
PROBLEM: SITE IS TOO SLOW
RES
ULT
: AN
GR
Y C
US
TO
MER
S
HOW TO PREVENT PROBLEMS WITH PERFORMANCE?
Frontend
Server’s tuning
DB
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
TIPS: REPOSITORIES
1. Do not use XML or HTML repositories2. Configure repository item caching
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
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.
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
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