---
title: Improving the performance of the Spring-Petclinic sample application (part 1 of 5)
description: "This post is a performance audit of the “spring-petclinic” sample application\n[https://github.com/SpringSource/spring-petclinic] provided by\nVMWare/SpringSource as a demonstration of the latest Spring features and\nconfigurations.\n\nWe are going to do a step-by-step audit of the application, and show:\n\n * Tools & techniques we usually work with when"
image: https://blog.ippon.tech/hubfs/Imported_Blog_Media/ippon-bkr-Jan-18-2024-06-11-24-2135-PM.png
---

[Skip to main content](https://blog.ippon.tech/improving-the-performance-of-the-spring-petclinic-sample-application-part-1-of-5#main)

[![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=219&height=64&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=219&height=64&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=168&height=49&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=168&height=49&name=IpponLogoKleinBlue.png)](https://ipponusa.com/)

- [Home](https://ipponusa.com)
- [Show submenu for About About](https://ipponusa.com/about-us) 
    - [Who We Are](https://ipponusa.com/who-we-are)
    - [Careers](https://ipponusa.com/careers)
    - [Show submenu for Our Partners Our Partners](https://ipponusa.com/our-partners/) 
          - [AWS](https://ipponusa.com/our-partners/aws/)
          - [Snowflake](https://ipponusa.com/our-partners/snowflake/)
          - [Databricks](https://ipponusa.com/our-partners/databricks/)
          - [Microsoft](https://ipponusa.com/our-partners/microsoft/)
- [Show submenu for Services Services](https://ipponusa.com/services) 
    - [Snowflake](https://ipponusa.com/service/snowflake-concierge/)
    - [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
    - [Data & Analytics](https://ipponusa.com/service/data-analytics/)
    - [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
    - [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
    - [Product Innovation](https://ipponusa.com/service/product-innovation/)
    - [Operating Model](https://ipponusa.com/service/operating-model/)
- [Blogs](https://blog.ippon.tech/)
- [Success Stories](https://ipponusa.com/success-stories/)
- [Show submenu for Resources Resources](https://ipponusa.com/resources/) 
    - [eBooks](https://ipponusa.com/ebooks/)
    - [The Data Pour](https://info.ippon.tech/the-data-pour)
    - [Videos & Webinars](https://info.ippon.tech/videos-and-webinars)
    - [Media Center](https://ipponusa.com/media-center/)

Search

Open main navigation

Close main navigation

- [Home](https://ipponusa.com)
- Show submenu for About About 
  
    - About
    - [About](https://ipponusa.com/about-us)
    - [Who We Are](https://ipponusa.com/who-we-are)
    - [Careers](https://ipponusa.com/careers)
    - Show submenu for Our Partners Our Partners 
      
          - Our Partners
          - [Our Partners](https://ipponusa.com/our-partners/)
          - [AWS](https://ipponusa.com/our-partners/aws/)
          - [Snowflake](https://ipponusa.com/our-partners/snowflake/)
          - [Databricks](https://ipponusa.com/our-partners/databricks/)
          - [Microsoft](https://ipponusa.com/our-partners/microsoft/)
- Show submenu for Services Services 
  
    - Services
    - [Services](https://ipponusa.com/services)
    - [Snowflake](https://ipponusa.com/service/snowflake-concierge/)
    - [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
    - [Data & Analytics](https://ipponusa.com/service/data-analytics/)
    - [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
    - [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
    - [Product Innovation](https://ipponusa.com/service/product-innovation/)
    - [Operating Model](https://ipponusa.com/service/operating-model/)
- [Blogs](https://blog.ippon.tech/)
- [Success Stories](https://ipponusa.com/success-stories/)
- Show submenu for Resources Resources 
  
    - Resources
    - [Resources](https://ipponusa.com/resources/)
    - [eBooks](https://ipponusa.com/ebooks/)
    - [The Data Pour](https://info.ippon.tech/the-data-pour)
    - [Videos & Webinars](https://info.ippon.tech/videos-and-webinars)
    - [Media Center](https://ipponusa.com/media-center/)
- Search
- [Contact Us](https://ipponusa.com/contact/)

[Contact Us](https://ipponusa.com/contact/)

# Improving the performance of the Spring-Petclinic sample application (part 1 of 5)

![Julien Dubois](https://app.hubspot.com/settings/avatar/d41d8cd98f00b204e9800998ecf8427e)

 by [Julien Dubois](https://blog.ippon.tech/author/julien-dubois)

March 11, 2013

![Improving the performance of the Spring-Petclinic sample application (part 1 of 5)](https://blog.ippon.tech/hubfs/Imported_Blog_Media/ippon-bkr-Jan-18-2024-06-11-24-2135-PM.png)

[Performance](https://blog.ippon.tech/tag/performance/) [Spring](https://blog.ippon.tech/tag/spring/)

 

[Julien Dubois](https://blog.ippon.tech/author/jdubois/)  Mar 11, 2013

 

This post is a performance audit of the [“spring-petclinic” sample application](https://github.com/SpringSource/spring-petclinic?ref=blog.ippon.tech) provided by VMWare/SpringSource as a demonstration of the latest Spring features and configurations.

We are going to do a step-by-step audit of the application, and show:

- Tools & techniques we usually work with when doing a performance audit
- Common pitfalls and how to avoid them

For doing this audit, we will use our own fork of the project, which is located at: [https://github.com/jdubois/spring-petclinic](https://github.com/jdubois/spring-petclinic?ref=blog.ippon.tech)

As this tuning is a bit long, we have split it into 5 parts, which we will post every day this week:

- Monday: setting up the tests
- Tuesday: going stateless and Tomcat tuning
- Wednesday: removing the JVM locks
- Thursday: should we stay on JDBC, or is JPA better?
- Friday: adding a cache, and final words

Many thanks to:

- [Pierre Templier](https://twitter.com/ptemplier?ref=blog.ippon.tech) and [Christophe Parageaud](http://blog.ippon.fr/author/Christophe_PARAGEAUD/?ref=blog.ippon.tech), from Ippon Technologies, for proof-reading this analysis.
- [Michaël Isvy](https://twitter.com/michaelisvy?ref=blog.ippon.tech) from SpringSource/VMWare, who is the main developer of the Spring-petclinic application, for helping me and allowing me to torture his application.
- [Thibault Duchateau](https://twitter.com/tduchateau?ref=blog.ippon.tech) and [Romain Lespinasse](https://twitter.com/rlespinasse?ref=blog.ippon.tech) from the Dandelion Project, for correcting their library at an unbelievable speed.
- [James Ward](https://twitter.com/_JamesWard?ref=blog.ippon.tech), the author of WebJars, for best practices in using his library.

## Creating a JMeter test

First of all, we have configured the application to be in “production” mode:

- We defined the logging level to error [\[Source code\]](https://github.com/jdubois/spring-petclinic/commit/2c9a37179d7abe3aa057fee200966a2412e4c2e8?ref=blog.ippon.tech)
- We have configured the application to use MySQL (as in this project HSQLDB runs in the same JVM as the application, and thus will distort profiling) [\[Source code\]](https://github.com/jdubois/spring-petclinic/commit/58ce7d6d794c69696d23d62616221a4708d13455?ref=blog.ippon.tech)

We’ve created a JMeter test, which is available [here](https://github.com/jdubois/spring-petclinic/commit/69e55e406db37a386ff8348a5a84343801169f85?ref=blog.ippon.tech).

We have run this test a first time, with the “POST new visit” step activated, in order to create 10 visits per pet. This means running this test with 10 threads, doing 13 loops each (as there are 13 pets). The “POST new visit” step was then disabled: the application does not paginate visits, so doing inserts will just break it down really quickly.

As visits are the main objects that are being created in the application, they should have been paginated, or there should be at least a limit on the dataset that is returned. On the other hand, it would be really strange that a user has a pet that goes 1000 times to the vet, so this would not be a realistic test case.

That’s why we have decided to limit this test to 10 visits per pet: this is important, as this will have an impact in the future tests.

We have have then run the test normally (using “*mvn clean tomcat7:run*“), with a 2011 Macbook Pro, with 500 concurrent users each doing the test 10 times.

It is also important to mention that:

- Everything is on the same computer: Tomcat, MySQL, JMeter… This is not a “production” architecture but it’s easier to diagnose/debug it that way
- We use Tomcat 7, with Java 1.6 and 128M of RAM
- We have been careful in doing a “*mvn clean*” in the process, in order to remove older HTTP session states
- We do a “warm up” of the application before launching the tests, so the JIT compiler has the time to optimize the application

We have also run those tests on several other computers, with the same results (proportionally, some having more CPU power than the others).

The first results are as follow: the application quickly goes up to **285 requests per second (req/sec)**, then slows down and throws “**java.lang.OutOfMemoryError: Java heap space**” errors after nearly 700 users. We then have lots of HTTP errors, and the application gets so slow it is not usable anymore.

Of course, we can give more memory to the application, so that it can handle our 5000 users. With 1 Gigabytes of heap, the application can handle the load, with a result of **548 req/sec and 0,2% of HTTP errors**.

## Conclusion of part 1

The application cannot handle a lot of load: with 128 MB of RAM, the application starts to **fail after 600 simultaneous users**, which is a rather small number. Of course, we can give it more RAM to push that limit: we will be able to have more users, but as the GC will have more work, it is likely that the application does not perform very well.

We will see tomorrow, in the next episode of this series, how we started to solve that problem.

\[edit\]

You can find the other episodes of this series here : [part 2](http://blog.ippon.fr/?p=7500&ref=blog.ippon.tech), [part 3](http://blog.ippon.fr/?p=7512&ref=blog.ippon.tech), [part 4](http://blog.ippon.fr/?p=7520&ref=blog.ippon.tech) and [part 5](http://blog.ippon.fr/?p=7527&ref=blog.ippon.tech).

## Related Articles

##### [![Deep Dive Webflux](https://blog.ippon.tech/hs-fs/hubfs/1-2.png?width=520&height=294&name=1-2.png) Spring • July 11, 2024 Deep Dive Webflux 4 min read](https://blog.ippon.tech/deep-dive-webflux)

##### [![Getting Your Application Started With WebFlux](https://blog.ippon.tech/hs-fs/hubfs/Webflux%20image%20(1).png?width=520&height=294&name=Webflux%20image%20(1).png) Spring • May 7, 2024 Getting Your Application Started With WebFlux 6 min read](https://blog.ippon.tech/getting-your-application-started-with-webflux)

##### [![Webflux - Starting your journey](https://blog.ippon.tech/hs-fs/hubfs/Untitled%20design.png?width=520&height=294&name=Untitled%20design.png) Ippon • March 19, 2024 Webflux - Starting your journey 6 min read](https://blog.ippon.tech/webflux-starting-your-journey)

### Comments

### Subscribe to Our Blog!

Stay informed with the latest insights and updates by signing up for our weekly blog newsletter – delivered straight to your inbox!

[Back to blog homepage »](https://blog.ippon.tech/)

![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=247&height=73&name=IpponLogoKleinBlue.png "IpponLogoKleinBlue")

Ippon is a consulting and expertise firm, who is convinced that technology is a source of progress for society. We help our clients leverage their digital assets to design an appropriate strategy and deploy their transformation roadmap at scale.

#### Navigation

- [Home](https://ipponusa.com/)
- [About](https://ipponusa.com/about-us/)
- [Services](https://ipponusa.com/services/)
- [Blogs](https://blog.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)
- [eBooks](https://ipponusa.com/ebooks/)
- [The Data Pour](https://info.ippon.tech/the-data-pour?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)

[Contact Us](https://ipponusa.com/contact/)

[Join Us](https://ipponusa.com/careers/)

#### Services

- [Data & Analytics](https://ipponusa.com/service/data-analytics/)
- [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
- [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
- [Operating Model](https://ipponusa.com/service/operating-model/)
- [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
- [Product Innovation](https://ipponusa.com/service/product-innovation/)

#### Ippon International

- [France](https://fr.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)
- [Australia](https://au.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)

- #### Contact
- Ippon Technologies  
  [3431 West Leigh Street Richmond, VA 23230, USA](https://maps.app.goo.gl/RySm6SAwZnsxeiLz9)
-  
- [(844) 477- 6687](tel:8444776687)
-  
- [Sales@ipponusa.com](mailto:Sales@ipponusa.com)

<https://www.facebook.com/IpponUSA/> <https://www.youtube.com/c/ipponusa> <https://www.linkedin.com/company/ippon-technology>

©Copyright 2024 Ippon USA. All Rights Reserved.   |   [Terms and Conditions](https://ipponusa.com/privacy-policy/)   |   [Privacy Policy](https://ipponusa.com/privacy-policy/)   |   [Website by Skol Marketing](https://skolmarketing.com/)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Julien Dubois",
    "url" : "https://blog.ippon.tech/author/julien-dubois"
  },
  "dateModified" : "2024-01-25T17:59:36.204Z",
  "datePublished" : "2013-03-11T17:59:00.000Z",
  "headline" : "Improving the performance of the Spring-Petclinic sample application (part 1 of 5)",
  "image" : [ "https://blog.ippon.tech/hubfs/Imported_Blog_Media/ippon-bkr-Jan-18-2024-06-11-24-2135-PM.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.ippon.tech/improving-the-performance-of-the-spring-petclinic-sample-application-part-1-of-5",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.ippon.tech/hubfs/logo_SVG.svg"
    },
    "name" : "Ippon Technologies"
  }
}
```