{"id":1175,"date":"2023-11-24T20:49:40","date_gmt":"2023-11-24T15:19:40","guid":{"rendered":"https:\/\/www.techandtrain.com\/blog\/?p=1175"},"modified":"2025-10-22T14:52:14","modified_gmt":"2025-10-22T09:22:14","slug":"liferay-best-practices-part-2","status":"publish","type":"post","link":"https:\/\/www.techandtrain.com\/blog\/2023\/11\/liferay-best-practices-part-2\/","title":{"rendered":"Liferay best practices &#8211; Part 2"},"content":{"rendered":"\n<p id=\"ember20707\">Following up with Part 1 of the series here:&nbsp;<a href=\"https:\/\/www.linkedin.com\/pulse\/liferay-best-practices-part-1-neil-harwani\/\">Liferay best practices &#8211; Part 1 | LinkedIn &#8211;<\/a>&nbsp;Here is part 2 of Liferay best practices:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Look out for settings of ORA-1795 error and it&#8217;s required settings from Liferay Help Center articles if you are using Oracle<\/li>\n\n\n\n<li>If you have heavy usage of web articles, assets, documents and so on, consider switching off view \/ increment count via&nbsp;<a href=\"http:\/\/portal-ext.properties\/\">portal-ext.properties<\/a>&nbsp;and user interface of control panel &#8211; it will prevent DB locks<\/li>\n\n\n\n<li>Consider JVM tuning for meta space, heap, young generation, type of garbage collection and so on regularly based on usage<\/li>\n\n\n\n<li>Review caching at fragment level, EHCache, do query analysis and GC analysis regularly<\/li>\n\n\n\n<li>Use CDN (Content delivery network) and web server caching for static assets &#8211; don&#8217;t cache cookies<\/li>\n\n\n\n<li>Use a good, standard WAF (Web application firewall) for public websites<\/li>\n\n\n\n<li>Review your cluster settings in JAVA_OPTS, tcp.xml and&nbsp;<a href=\"http:\/\/portal-ext.properties\/\">portal-ext.properties<\/a>&nbsp;&#8211; Also, check adding \/ editing content on one node and checking on another &#8211; whether it reflects there or not for cluster health<\/li>\n\n\n\n<li>Use a monitoring tool (APM). If you use Glowroot, then install it in Central pattern<\/li>\n\n\n\n<li>Review your Elastic Search cluster in terms of heap, embedded JVM and performance tuning regularly<\/li>\n\n\n\n<li>Check the stale entries for ElasticSearch in background jobs table<\/li>\n\n\n\n<li>Regularly check your blocked \/ waiting \/ timed_waiting threads at peak load<\/li>\n\n\n\n<li>Take heap dumps to analyze the heap regularly at peak load<\/li>\n\n\n\n<li>Review Liferay deployment, compatibility, security and other checklists \/ matrix<\/li>\n\n\n\n<li>Vertically &amp; horizontally scale, performance tune, change heap\/GC and so on based on regular analysis of heap\/thread dumps and load tests<\/li>\n\n\n\n<li>Check errors &amp; warnings in logs regularly<\/li>\n\n\n\n<li>Set up filestore in advanced format right from the start<\/li>\n\n\n\n<li>If you are migrating from another technology or product, setup a migration checklist<\/li>\n\n\n\n<li>Routinely fine tune your tracing in logs from custom code and SERVER ADMINISTRATION section in control panel<\/li>\n\n\n\n<li>Fine tune your app server threads<\/li>\n\n\n\n<li>Setup error pages and redirects as needed<\/li>\n\n\n\n<li>Block rogue IPs via web server or servlet filters<\/li>\n\n\n\n<li>Map to security patches and quarterly releases<\/li>\n\n\n\n<li>Enable email based password reset and \/ or TFA \/ MFA<\/li>\n\n\n\n<li>Map SSO \/ LDAP \/ SAML based authentication as needed<\/li>\n\n\n\n<li>Check your control panel password is complex enough or not?<\/li>\n\n\n\n<li>Size your hardware and check your NAS\/SAN\/iNode limits in load test<\/li>\n\n\n\n<li>Check your Hikari pool \/ DB settings \/ connection pool timeout \/ server side timeout and fine tune it<\/li>\n\n\n\n<li>Check large web content \/ large documents and test them in terms of download \/ views and more<\/li>\n\n\n\n<li>Set up a backup \/ DevOps \/ DevSecOps strategy<\/li>\n\n\n\n<li>Set up automated heap dump and automated thread dumps<\/li>\n\n\n\n<li>Change JDK certificate store password from default<\/li>\n\n\n\n<li>ElasticSearch, DB should not be in side car pattern<\/li>\n\n\n\n<li>Use Expando, dynamic query and service builder for database and not direct JDBC calls<\/li>\n\n\n\n<li>Ownership and start \/ stop of app server, file store folders should be via the app server user not root<\/li>\n\n\n\n<li>There are various blogs on Liferay about to debug liferay, how to debug cluster, new features, Glowroot, performance tuning &#8211; kindly search and refer them<\/li>\n\n\n\n<li>Setup code quality scans via SONAR and similar<\/li>\n\n\n\n<li>Maintain a Non-Functional Requirements checklist<\/li>\n\n\n\n<li>Keep operational hygiene of DevOps, Automation, Delivery, Management, ITIL, Agile, Scrum, Secrets, Patterns, Architecture, Design, Debugging, Quality, Procedures, Documentation, Training, Knowledge Transfer, Access Control, Data &amp; Process Governance, Monitoring, Reporting, Communication, Project and Product Management, Tools used, Ownership, Accountability, Collaboration, Security and more<\/li>\n\n\n\n<li>Analyze your future needs of traffic, usage, infra, load and so on regularly<\/li>\n\n\n\n<li>When you do a load test: refer average response time, response time, throughput, transactions per second\/minute, cores, memory, heap, CPU, concurrent users, JMeter script, usage of pages, types of transactions and so on for a comprehensive answer instead of just concurrent users<\/li>\n\n\n\n<li>Refer official sources like: Liferay Dev forums &amp; blogs, Liferay learn, Liferay YouTube, Liferay GitHub, Liferay Help Center &#8211; it has type ahead, Liferay Support ticketing system, Liferay Customer portal,&nbsp;<a href=\"http:\/\/liferay.com\/\">Liferay.com<\/a>&nbsp;for all your problems first<\/li>\n\n\n\n<li>Here are two GPTs that can assist you in your work with Liferay &#8211; please report it&#8217;s fine tuning \/ hallucinations to me at email below for me to fine tune them:&nbsp;<a href=\"https:\/\/lnkd.in\/d2G8mPsA\">https:\/\/lnkd.in\/d2G8mPsA<\/a>&nbsp;&#8211; Liferay Helper which works on open internet&nbsp;<a href=\"https:\/\/lnkd.in\/dqVzNwCj\">https:\/\/<\/a><a href=\"http:\/\/lnkd.in\/dqVzNwCj\">lnkd.in\/dqVzNwCj<\/a>&nbsp;&#8211; Liferay Guide which works on only official sources<\/li>\n<\/ul>\n\n\n\n<p id=\"ember20709\">Email me:&nbsp;<a href=\"mailto:Neil@HarwaniSystems.in\">Neil@HarwaniSystems.in<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following up with Part 1 of the series here:&nbsp;Liferay best practices &#8211; Part 1 | LinkedIn &#8211;&nbsp;Here is part 2 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1176,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[192],"tags":[319,200],"class_list":["post-1175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-liferay","tag-best-practices","tag-liferay"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Best-Practice.jpg?fit=1280%2C960&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7do02-iX","jetpack-related-posts":[{"id":965,"url":"https:\/\/www.techandtrain.com\/blog\/2022\/10\/liferay-best-practices-part-1\/","url_meta":{"origin":1175,"position":0},"title":"Liferay best practices &#8211; Part 1","author":"Neil Harwani","date":"October 11, 2022","format":false,"excerpt":"Developers and managers both struggle at times to pre-plan usage of best practices in projects causing many problems which are best avoided. Providing below some learnings & best practices on using and working with Liferay \u2013 Part 1. Don\u2019t work directly on the Liferay database. Use the groovy script console\u2026","rel":"","context":"In &quot;Liferay&quot;","block_context":{"text":"Liferay","link":"https:\/\/www.techandtrain.com\/blog\/category\/liferay\/"},"img":{"alt_text":"Credit: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2022\/10\/Web-Design.jpg?fit=1200%2C720&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2022\/10\/Web-Design.jpg?fit=1200%2C720&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2022\/10\/Web-Design.jpg?fit=1200%2C720&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2022\/10\/Web-Design.jpg?fit=1200%2C720&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2022\/10\/Web-Design.jpg?fit=1200%2C720&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1132,"url":"https:\/\/www.techandtrain.com\/blog\/2023\/09\/what-you-should-not-be-doing-in-liferay-part-1\/","url_meta":{"origin":1175,"position":1},"title":"What you should not be doing in Liferay &#8211; Part 1","author":"Neil Harwani","date":"September 30, 2023","format":false,"excerpt":"Here is a list of what you should not be doing in Liferay - Part 1 and also what you should be doing written right next to it in place of the wrong things: Write JDBC calls in portlets. Avoid JDBC calls in portlets. Please explore expando, service builder, dynamic\u2026","rel":"","context":"In &quot;Liferay&quot;","block_context":{"text":"Liferay","link":"https:\/\/www.techandtrain.com\/blog\/category\/liferay\/"},"img":{"alt_text":"Credit: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/09\/caution-943376_1280.png?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/09\/caution-943376_1280.png?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/09\/caution-943376_1280.png?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/09\/caution-943376_1280.png?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/09\/caution-943376_1280.png?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1163,"url":"https:\/\/www.techandtrain.com\/blog\/2023\/11\/what-are-some-of-the-best-practices-for-liferay-using-three-separate-gpts\/","url_meta":{"origin":1175,"position":2},"title":"What are some of the best practices for Liferay? &#8211; Using three separate GPTs","author":"Neil Harwani","date":"November 20, 2023","format":false,"excerpt":"Generated using my GPT -\u00a0Liferay Guide - Via official sources of Liferay:\u00a0https:\/\/chat.openai.com\/g\/g-4G5XuBdpL-liferay-guide-via-official-sources-of-liferay Adhering to best practices in Liferay ensures that you leverage the platform effectively for enterprise solutions. Here are some key best practices to consider: 1.\u00a0Modular Development: Embrace Liferay\u2019s modular development approach using OSGi. Develop customizations in modules, rather\u2026","rel":"","context":"In &quot;Liferay&quot;","block_context":{"text":"Liferay","link":"https:\/\/www.techandtrain.com\/blog\/category\/liferay\/"},"img":{"alt_text":"Credits: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Fantasy-Portal.jpg?fit=1200%2C909&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Fantasy-Portal.jpg?fit=1200%2C909&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Fantasy-Portal.jpg?fit=1200%2C909&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Fantasy-Portal.jpg?fit=1200%2C909&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Fantasy-Portal.jpg?fit=1200%2C909&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1184,"url":"https:\/\/www.techandtrain.com\/blog\/2023\/11\/content-management-system-feature-best-practices-in-liferay-part-1\/","url_meta":{"origin":1175,"position":3},"title":"Content Management System feature best practices in Liferay &#8211; Part 1","author":"Neil Harwani","date":"November 29, 2023","format":false,"excerpt":"Here are some best practices for content management system feature usage in Liferay - Part 1. Separate the technical work of portlet creation, hooks, APIs, integration, themes, master templates and so on from content publishing work. Once technical work is done, setup publications feature on your production environment and publish\u2026","rel":"","context":"In &quot;Content Management&quot;","block_context":{"text":"Content Management","link":"https:\/\/www.techandtrain.com\/blog\/category\/content-management\/"},"img":{"alt_text":"Credits: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/MixedMedia.jpg?fit=1200%2C1019&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/MixedMedia.jpg?fit=1200%2C1019&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/MixedMedia.jpg?fit=1200%2C1019&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/MixedMedia.jpg?fit=1200%2C1019&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/MixedMedia.jpg?fit=1200%2C1019&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1030,"url":"https:\/\/www.techandtrain.com\/blog\/2023\/02\/how-to-debug-liferay-some-pointers-part-1\/","url_meta":{"origin":1175,"position":4},"title":"How to debug Liferay? &#8211; Some pointers &#8211; Part 1","author":"Neil Harwani","date":"February 19, 2023","format":false,"excerpt":"How to debug Liferay? Some pointers. - Part 1. Many a times, we only check at specific places and forget other areas while debugging. This small blog acts as a checklist to check and debug Liferay. Look at installing and using GLOWROOT Check the slow traces \/ web transactions \/\u2026","rel":"","context":"In &quot;Liferay&quot;","block_context":{"text":"Liferay","link":"https:\/\/www.techandtrain.com\/blog\/category\/liferay\/"},"img":{"alt_text":"Credit: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/02\/tool-gf2582e850_1280.png?fit=1200%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/02\/tool-gf2582e850_1280.png?fit=1200%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/02\/tool-gf2582e850_1280.png?fit=1200%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/02\/tool-gf2582e850_1280.png?fit=1200%2C1200&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/02\/tool-gf2582e850_1280.png?fit=1200%2C1200&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1169,"url":"https:\/\/www.techandtrain.com\/blog\/2023\/11\/common-programming-mistakes-in-liferay-gpt-generated\/","url_meta":{"origin":1175,"position":5},"title":"Common programming mistakes in Liferay &#8211; GPT generated","author":"Neil Harwani","date":"November 20, 2023","format":false,"excerpt":"Generated using my GPT:\u00a0https:\/\/chat.openai.com\/g\/g-uOPo2Wffl-liferay-helper-works-on-open-internet Common programming mistakes in Liferay often stem from overlooking best practices in both Liferay-specific and general Java development. Some of these mistakes include: 1.\u00a0Ignoring Liferay's MVC Framework: Developers sometimes bypass Liferay's built-in MVC framework for portlets, which can lead to more complex code and maintenance issues.\u2026","rel":"","context":"In &quot;Liferay&quot;","block_context":{"text":"Liferay","link":"https:\/\/www.techandtrain.com\/blog\/category\/liferay\/"},"img":{"alt_text":"Credits: www.Pixabay.com","src":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Mistake.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Mistake.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Mistake.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Mistake.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.techandtrain.com\/blog\/wp-content\/uploads\/2023\/11\/Mistake.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/posts\/1175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/comments?post=1175"}],"version-history":[{"count":3,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/posts\/1175\/revisions"}],"predecessor-version":[{"id":1179,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/posts\/1175\/revisions\/1179"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/media\/1176"}],"wp:attachment":[{"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/media?parent=1175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/categories?post=1175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techandtrain.com\/blog\/wp-json\/wp\/v2\/tags?post=1175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}