Improving the Performance of a Grails Application

Neev Technologies
Neev TechnologiesNeev Technologies
Improving the Performance of a Grails
Application
About Neev
Web

Mobile

Magento eCommerce
SaaS Applications
Video Streaming Portals
Rich Internet Apps
Custom Development

iPhone
Android
Windows Phone 7
HTML5 Apps

Cloud
AWS Consulting Partner
Rackspace
Joyent
Heroku
Google App Engine

Key Company Highlights
250+ team with experience in
managing
offshore, distributed
development.
Neev Technologies
established in Jan ’05
VC Funding in 2009 By Basil
Partners

User Interface Design and User Experience Design

Part of Publicis Groupe
Member of NASSCOM.

Performance Consulting Practices
Development Centers in
Bangalore and Pune.
Quality Assurance & Testing

Outsourced Product Development

Offices at
Bangalore, USA, Delhi, Pune,
Singapore and Stockholm.
The Scenario used for Testing Grails Application Performance
• Medium EC2 with RDS having no IOPS
• Grails 2.1.1 environment with a number of plugins

• Huge DB with transactions trying to insert as many as 100k records
• New setup was limited in terms of CPU and memory resources and therefore
reveal more glaring mistakes in code with regard to performance
considerations
What helps to Improve Performance
• Paste the code in console and type ‘Ctrl+R’. No need to navigate through
screens or authentication
• Change domain module to include only a reference of the parents key
instead of the whole object.
• Enable Hibernate’s second level of caching by adding suitable code to
DataSource.groovy and by making changes in the domain class

• Configure ehcache.xml
• Create indexes on parent classes after using explain on MySQL tables. This
improves performance marginally
• Cleaning up Gorm after doing batch inserts also helps
• Refer page for relevant code :
http://www.neevtech.com/blog/2013/02/08/improving-your-grailsapplication-performance-look-jim-no-stored-procedures/
The Real Bottleneck and the Solution
• The session cache was very large because Grails has FlushMode set to ‘AUTO’
• It was observed that Grails makes a Session ‘Flush’ before querying - this could be

reducing performance
The remedy is to:
• Import org.hibernate.FlushMode
• Include this line, session.setflushMode (FlushMode.COMMIT)
• Performance improvement after these changes - processes nearly 450k records in 1
hour as opposed to 20k records earlier in 2 hours.
• Refer for relevant code and more info :
http://www.neevtech.com/blog/2013/02/08/improving-your-grails-applicationperformance-look-jim-no-stored-procedures/
Clients
Partnerships
Neev Information Technologies Pvt. Ltd.
India - Bangalore

India - Pune

The Estate, # 121,6th Floor,

#13 L’Square, 3rd Floor

Dickenson Road

Parihar Chowk, Aundh,

Bangalore-560042

Pune – 411007.

Phone :+91 80 25594416

Phone : +91-64103338

USA

sales@neevtech.com
Sweden

Singapore

Neev AB, Birger Jarlsgatan
1121 Boyce Rd Ste 1400,
Pittsburgh PA 15241

Phone : +1 888-979-7860

#08-03 SGX Centre 2, 4

53, 6tr,

Shenton Way,

11145, Stockholm

Singapore 068807

Phone: +46723250723

Phone: +65 6435 1961

For more info on our offerings, visit www.neevtech.com
1 of 8

Recommended

Performance tuning Grails applications by
Performance tuning Grails applicationsPerformance tuning Grails applications
Performance tuning Grails applicationsLari Hotari
3.9K views19 slides
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook by
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf
3.2K views25 slides
Advanced GORM - Performance, Customization and Monitoring by
Advanced GORM - Performance, Customization and MonitoringAdvanced GORM - Performance, Customization and Monitoring
Advanced GORM - Performance, Customization and MonitoringBurt Beckwith
1.6K views37 slides
Razorfish India (Neev) Corporate Profile by
Razorfish India (Neev) Corporate ProfileRazorfish India (Neev) Corporate Profile
Razorfish India (Neev) Corporate ProfileNeev Technologies
1.4K views48 slides
Adobe Experience Manager (Adobe CQ) Capabilities and Experience @ Neev by
Adobe Experience Manager (Adobe CQ) Capabilities and Experience @ NeevAdobe Experience Manager (Adobe CQ) Capabilities and Experience @ Neev
Adobe Experience Manager (Adobe CQ) Capabilities and Experience @ NeevNeev Technologies
2.6K views17 slides
Hybris Hackathon - Split Payments in Hybris by
Hybris Hackathon - Split Payments in HybrisHybris Hackathon - Split Payments in Hybris
Hybris Hackathon - Split Payments in HybrisNeev Technologies
2.9K views15 slides

More Related Content

More from Neev Technologies

Gameathon @ Neev by
Gameathon @ NeevGameathon @ Neev
Gameathon @ NeevNeev Technologies
764 views16 slides
Building A Jewelry e-store - Now, sell your jewelry to the world! by
Building A Jewelry e-store - Now, sell your jewelry to the world!Building A Jewelry e-store - Now, sell your jewelry to the world!
Building A Jewelry e-store - Now, sell your jewelry to the world!Neev Technologies
973 views24 slides
Neev Load Testing Services by
Neev Load Testing ServicesNeev Load Testing Services
Neev Load Testing ServicesNeev Technologies
725 views15 slides
How to add Custom Font to your iOS-based App? by
How to add Custom Font to your iOS-based App?How to add Custom Font to your iOS-based App?
How to add Custom Font to your iOS-based App?Neev Technologies
935 views18 slides
Our Experience on Google Map Integration with Apps by
Our Experience on Google Map Integration with AppsOur Experience on Google Map Integration with Apps
Our Experience on Google Map Integration with AppsNeev Technologies
1.1K views18 slides
Neev Application Performance Management Services by
Neev Application Performance Management ServicesNeev Application Performance Management Services
Neev Application Performance Management ServicesNeev Technologies
779 views13 slides

More from Neev Technologies(20)

Building A Jewelry e-store - Now, sell your jewelry to the world! by Neev Technologies
Building A Jewelry e-store - Now, sell your jewelry to the world!Building A Jewelry e-store - Now, sell your jewelry to the world!
Building A Jewelry e-store - Now, sell your jewelry to the world!
Neev Technologies973 views
How to add Custom Font to your iOS-based App? by Neev Technologies
How to add Custom Font to your iOS-based App?How to add Custom Font to your iOS-based App?
How to add Custom Font to your iOS-based App?
Neev Technologies935 views
Our Experience on Google Map Integration with Apps by Neev Technologies
Our Experience on Google Map Integration with AppsOur Experience on Google Map Integration with Apps
Our Experience on Google Map Integration with Apps
Neev Technologies1.1K views
Neev Application Performance Management Services by Neev Technologies
Neev Application Performance Management ServicesNeev Application Performance Management Services
Neev Application Performance Management Services
Neev Technologies779 views
Business Intelligence Capabilities @ Neev by Neev Technologies
Business Intelligence Capabilities @ NeevBusiness Intelligence Capabilities @ Neev
Business Intelligence Capabilities @ Neev
Neev Technologies751 views
Neev Conversion Strategy Capabilities by Neev Technologies
Neev Conversion Strategy CapabilitiesNeev Conversion Strategy Capabilities
Neev Conversion Strategy Capabilities
Neev Technologies1.2K views
A Digital Mirror for Luxury Jewelry Stores by Neev Technologies
A Digital Mirror for Luxury Jewelry StoresA Digital Mirror for Luxury Jewelry Stores
A Digital Mirror for Luxury Jewelry Stores
Neev Technologies1.7K views
Native Mobile Platforms vs Phonegap – A Comparison by Neev Technologies
Native Mobile Platforms vs Phonegap – A ComparisonNative Mobile Platforms vs Phonegap – A Comparison
Native Mobile Platforms vs Phonegap – A Comparison
Neev Technologies1.9K views
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014 by Neev Technologies
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014
Test Automation - Presented by Nagarajan, Architect @ TechCafe-2014
Neev Technologies644 views
That thing called Requirements - Presented by Mona Walia, Business Analyst @ ... by Neev Technologies
That thing called Requirements - Presented by Mona Walia, Business Analyst @ ...That thing called Requirements - Presented by Mona Walia, Business Analyst @ ...
That thing called Requirements - Presented by Mona Walia, Business Analyst @ ...
Neev Technologies564 views
Trendywalks - A Hybris-based eCommerce Store with Custom Features by Neev Technologies
Trendywalks - A Hybris-based eCommerce Store with Custom FeaturesTrendywalks - A Hybris-based eCommerce Store with Custom Features
Trendywalks - A Hybris-based eCommerce Store with Custom Features

Recently uploaded

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
263 views23 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
160 views32 slides
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
170 views29 slides
CryptoBotsAI by
CryptoBotsAICryptoBotsAI
CryptoBotsAIchandureddyvadala199
40 views5 slides
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...ShapeBlue
166 views28 slides
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...ShapeBlue
180 views18 slides

Recently uploaded(20)

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue263 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson160 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc170 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue166 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue180 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue238 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker54 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue132 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue130 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue222 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash158 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10139 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue161 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu423 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue221 views

Improving the Performance of a Grails Application

  • 1. Improving the Performance of a Grails Application
  • 2. About Neev Web Mobile Magento eCommerce SaaS Applications Video Streaming Portals Rich Internet Apps Custom Development iPhone Android Windows Phone 7 HTML5 Apps Cloud AWS Consulting Partner Rackspace Joyent Heroku Google App Engine Key Company Highlights 250+ team with experience in managing offshore, distributed development. Neev Technologies established in Jan ’05 VC Funding in 2009 By Basil Partners User Interface Design and User Experience Design Part of Publicis Groupe Member of NASSCOM. Performance Consulting Practices Development Centers in Bangalore and Pune. Quality Assurance & Testing Outsourced Product Development Offices at Bangalore, USA, Delhi, Pune, Singapore and Stockholm.
  • 3. The Scenario used for Testing Grails Application Performance • Medium EC2 with RDS having no IOPS • Grails 2.1.1 environment with a number of plugins • Huge DB with transactions trying to insert as many as 100k records • New setup was limited in terms of CPU and memory resources and therefore reveal more glaring mistakes in code with regard to performance considerations
  • 4. What helps to Improve Performance • Paste the code in console and type ‘Ctrl+R’. No need to navigate through screens or authentication • Change domain module to include only a reference of the parents key instead of the whole object. • Enable Hibernate’s second level of caching by adding suitable code to DataSource.groovy and by making changes in the domain class • Configure ehcache.xml • Create indexes on parent classes after using explain on MySQL tables. This improves performance marginally • Cleaning up Gorm after doing batch inserts also helps • Refer page for relevant code : http://www.neevtech.com/blog/2013/02/08/improving-your-grailsapplication-performance-look-jim-no-stored-procedures/
  • 5. The Real Bottleneck and the Solution • The session cache was very large because Grails has FlushMode set to ‘AUTO’ • It was observed that Grails makes a Session ‘Flush’ before querying - this could be reducing performance The remedy is to: • Import org.hibernate.FlushMode • Include this line, session.setflushMode (FlushMode.COMMIT) • Performance improvement after these changes - processes nearly 450k records in 1 hour as opposed to 20k records earlier in 2 hours. • Refer for relevant code and more info : http://www.neevtech.com/blog/2013/02/08/improving-your-grails-applicationperformance-look-jim-no-stored-procedures/
  • 8. Neev Information Technologies Pvt. Ltd. India - Bangalore India - Pune The Estate, # 121,6th Floor, #13 L’Square, 3rd Floor Dickenson Road Parihar Chowk, Aundh, Bangalore-560042 Pune – 411007. Phone :+91 80 25594416 Phone : +91-64103338 USA sales@neevtech.com Sweden Singapore Neev AB, Birger Jarlsgatan 1121 Boyce Rd Ste 1400, Pittsburgh PA 15241 Phone : +1 888-979-7860 #08-03 SGX Centre 2, 4 53, 6tr, Shenton Way, 11145, Stockholm Singapore 068807 Phone: +46723250723 Phone: +65 6435 1961 For more info on our offerings, visit www.neevtech.com