5. CDN
• Content Distribution Networks (CDN) provide a distributed set of
proxy servers placed in multiple data centers across the internet.
• The Distributed Approach.
• Flexible control over content cacheability.
6. Varnish Caching
• It is HTTP accelerator know as caching HTTP reverse proxy
• Can be installed in front of hybris.
• Can be configured to cache contents (page fragments)
7. Web Server Caching Consideration
• Serve all static content from web server.
• Add header cache control in httpd.conf to cache static content:
• Header append Cache-Control public,max-age=600
• For detail configuration, refers to:
https://wiki.hybris.com/display/hybrisALF/Static+Content+Serving+fr
om+Apache
9. Hybris Platform Cache
• What to be cached?
• Data
• Why need caching?
• Improves the performance
• When Data is Cached?
• Hybris Region Cache provides fine-grained control in cache configuration.
• When Data is Removed from Cache?
• When cache max out.
• When cache entry is not valid any more.
10. Hybris Caching
• Regions based cache
• By default: EHCache implementation of region.
• Provided: hybris implementation as an option (for backward compatibility)
• Each region is configurable:
• What types it’s caching
• The maximum size
• The eviction policy
• Each hybris model is cached
• Each FS query is cached
• Hint: avoid FS queries with small differences (e.g. with new Date())
• No master cache server
11. Cluster Communication
• Each cluster has its own cache
• Caches are invalidated either TCP(JGroups) or UDP network messaging
• Clustering methods (Jgroups leverage udp mcast -recommended )
• JGroups provides fastest communication (can be used on cloud)
13. When Data Is Cached (and invalidated)
• Caching items:
• When calling flexible search or getters that refer to
ComposedTypes, the underlying data is returned from the
cache or, if not yet cached, first retrieved and then written to
the cache.
• When calling modelService.save, the cached value is
invalidated (and hence removed from the cache)
• Caching FlexibleSeach results:
• When executing FlexibleSearch query like: SELECT code FROM
Product the list of results is cached in the main cache.
• When a product is removed, then its item data and the cached
flexible search result for the above query are removed from
the cache.
14. Eviction policies
• First In, First Out (FIFO): Elements are evicted in the same order as
they come in. When a PUT call is made for a new element, and
assuming that the maximum limit is reached for the memory store,
the element that was placed first (First-In) in the store is the
candidate for eviction (First-Out).
• Least Frequently Used (LFU): For each GET call on the element the
number of hits is updated. When a PUT call is made for a new
element, and assuming that the maximum limit is reached for the
memory store, the element with least number of hits, the Less
Frequently Used element, is evicted.
15. Eviction policies - Continue
• Least Recently Used (LRU): The last used timestamp is updated when
an element is put into the cache or an element is retrieved from the
cache with a GET call.
16. How Data is Cached
• Region Cache – configurable
• Standard configuration:
Entity
Size:100,000
Eviction Stratagy: FIFO
Typesystem
Size:Unlimited
Eviction Stratagy: No
Query
Size:20,000
Eviction Stratagy: FIFO
Media
Size:500MB
Eviction Stratagy: LRU
18. Create New Custom Cache Region
• In core extension spring xml.
• In core-cache.xml create new cache region bean.
• In core-cache.xml add new created cache region bean into the cache
region list.
• Access caching by using DefaultCacheController.
19. Caching Configuration
• To change preconfigured cache region settings, provide new values in
the local.properties for the preconfigured parameters:
20. Performance – What Can Effect Performance?
• Transaction volume
• Poor system design – architecture level and code level.
• Poor caching design/setting.
• Poor database performance – data model issue or transactional issue.
• Poor network performance.
• Poor integration design – caution on real-time backend system
integration.
• Check here for some typical hybris performance issues and solutions:
https://wiki.hybris.com/display/hybrisALF/Typical+Performance+Issue
s
21. Performance Monitoring
– Area to Monitor
• Database access monitoring, include transaction based access.
• Database connection.
• Memory usage.
• Load distribution.
• Caching usage.
22. Tools to using for Monitoring
• Hybris Admin Console (hAC)
• Third Party Application Monitoring Tools
• dynaTrace
• New Relic (cloud based SaaS)
• JMX
34. Other Monitoring Tools
• New Relic – Cloud based monitoring tool
• JMX – Java Management Extension to expose various attributes
related to system properties, transactions, database statistics etc.