SlideShare a Scribd company logo
a talk for CocoonGT 2007 by Jeremy Quinn




                           Break My Site
      practical stress testing and tuning of Cocoon applications




 photo credit: Môsieur J




                                                                       1

This is designed as a beginner’s talk. I am the beginner.
scenario
                     Original
    400




    350



                                                Page Load (secs)
                                                Throughput (pages/min)
    300
                                                Stability %

                                             Approximately 600 hits per data-point
    250




    200




    150




    100




    50




     0
          1 10 20 30 40 50 60 70 80 90 100
            Users

                                                                                                2

My starting point for optimisation
You may be able to see how useless one person clicking in a browser is at testing, the server
never gets loaded.
Disregard the absolute speed values, this was done on my laptop.
scenario
                    Original
   400




   350



                                                Page Load (secs)
                                                Throughput (pages/min)
   300
                                                Stability %
                                 Average
                               seconds per
                                             Approximately 600 hits per data-point
                                  page
                                OUCH !!!!
   250




   200




   150

                          Throughput
                           pages per
                             minute
   100
                            EEEK !!!



    50




     0
         1 10 20 30 40 50 60 70 80 90 100
           Users

                                                                                          3

The original server configuration being taken to only 30 users, with disastrous eect.
Throughput drops to single figures, page load time climbs sky high, stability reduces by
nearly half.
From the logs I could see there were not enough threads or memory to cope.
This is badly broken.
scenario
                     Original


                                                                      accumulated optimisations
    400




                                                                           -–— what’s possible
    350



                                                 Page Load (secs)
                                                 Throughput (pages/min)
    300
                                                 Stability %

                                              Approximately 600 hits per data-point
                                              All graphs at the same scale
    250


                                             Memory  Thread Optimisation
    200




    150




    100




    50




     0
                                             1 10 20 30 40 50 60 70 80 90 100
          1 10 20 30 40 50 60 70 80 90 100
            Users

                                                                                                  4

Memory and Thread optimisation has made a tremendous dierence.
Now I can easily test up to 100 users, before I could not go past 30.
Page Load time, Throughput etc. is now linear with the increase in users.
At some point this configuration will also ‘break’, you need to know where this point is
so that you can plan for it not happening.
scenario
                     Original


                                                                      accumulated optimisations
    400




                                                                           -–— what’s possible
    350



                                                 Page Load (secs)
                                                 Throughput (pages/min)
    300
                                                 Stability %

                                              Approximately 600 hits per data-point
                                              All graphs at the same scale
    250


                                             Memory  Thread Optimisation               Read Optimisation
    200




    150




    100




    50




     0
                                             1 10 20 30 40 50 60 70 80 90 100
          1 10 20 30 40 50 60 70 80 90 100                                        1 10 20 30 40 50 60 70 80 90 100
            Users

                                                                                                                     5

The server is doing slightly less work due to this optimisation
This shows as the gradients flattening out a bit more.
scenario
                    Original


                                                                     accumulated optimisations
   400




                                                                          -–— what’s possible
   350



                                                Page Load (secs)
                                                Throughput (pages/min)
   300
                                                Stability %

                                             Approximately 600 hits per data-point
                                             All graphs at the same scale
   250


                                                                                                                           List Optimisation
                                            Memory  Thread Optimisation               Read Optimisation
                                                                                                                                                       200
   200




                                                                                                                                                       150
   150




                                                                                                                                                       100
   100




                                                                                                                                                       50
    50




     0                                                                                                                                                 0
                                            1 10 20 30 40 50 60 70 80 90 100
         1 10 20 30 40 50 60 70 80 90 100                                        1 10 20 30 40 50 60 70 80 90 100   1 10 20 30 40 50 60 70 80 90 100
           Users

                                                                                                                                                             6

Another optimisation, further reducing the work done on the server.
Flatter curves, better performance.

This gives you an idea of the scale of improvement you may be able to make.
In my case it is quite dramatic!
purpose
  what do I hope to achieve?




                                      photo credit: Brian Uhreen


                                                                              7

Load testing can be used to solve dierent sorts of problems.
You don’t want your site broken by popularity.
Find out how much trafic will make a site break, so you can plan to cope.
comparing changes

          • code optimisations
          • different implementations
          • caching strategies
          • different datasources
          • different server architectures


                                                               8

Load testing can be used during development to test changes.
test content


           • test the content of pages
           • test the behaviour of webapps




                                                                                      9

JMeter also has exhaustive tools for crawling and testing content within web pages.
It can also send parameters as POST requests etc. to help you test webapps.
gauge your server


           • get a specification
           • how many of what power of machine?
           • choosing and tuning a load-balancer




                                                                                               10

Before you start to work out what servers you need, you have to know what level of trafic it is
intended to cope with.
This has to come from either the implementation you are replacing or from marketing.
Test the machines you plan to use, so you know what capacity they can handle.
Round-Robins with machines of dierent capacities may work really badly.
planning
     what am I going to do?




                                      photo credit: Paul Goyette


                                                                   11

Plan well and hopefully you will get useful data
what can I change?

          • implementations
          • server configuration
             • memory
             • threads
          • system architecture


                                               12

What kind of changes do you want to compare?
what will happen?

              • build a mental model
              • predict what you expect to happen
              • learn to read the data
              • test your ideas against reality



                                                                             13

As your tests run, relate events in the server logs to how the graphs look
order of change

           • only make one change at a time
           • only make one change at a time
           • only make one change at a time
           • only make one change at a time



                                                    14

If there are several changes you can make
It is important to plan what order you do them in
order of change



           • have you got that?




                                                                              15

If you make more than one change at a time
you don’t know which change had what eect
which makes it more dificult to build a mental model of what is happening
order of change


          • in the most meaningful order
          • which depends on your purpose




                                                                        16

I tested optimisations before playing with threads and memory
For each change, I ran the tests again.
Optimisations may require dierent ideal thread and memory settings.
what tools?
          on MacOSX I used :

             • JMeter

             • Terminal

             • Console

             • Activity Monitor

             • Grab


                                                                         17

The tools I used to capture and watch real-time performance and issues
what tools?
           on MacOSX I used :

              • JMeter

              • Terminal

              • Console

              • Activity Monitor

              • Grab


                                                                                        18

I found it was fine to run JMeter on the server for running low level tests.
It is better to run JMeter on another machine though.
For very high throughput testing, you can aggregate results from many JMeter clients.
what tools?
          on MacOSX I used :

             • JMeter

             • Terminal

             • Console

             • Activity Monitor

             • Grab


                                             19

I can watch Cocoon in its Terminal window.
See errors as they happen
what tools?
           on MacOSX I used :

              • JMeter

              • Terminal

              • Console

              • Activity Monitor

              • Grab


                                                                         20

I used the Console to filter and watch Jetty’s logs for the repository.
what tools?
           on MacOSX I used :

              • JMeter

              • Terminal

              • Console

              • Activity Monitor

              • Grab


                                                                                 21

In Activity Monitor I can track threads, memory and cpu usage.
Here we can see the two java processes
The top one is Cocoon, the bottom one the repository
Here you can see that through bottlenecks, the system is being under-utilised.
IMHO both cores should be working fully on a well tuned system
setup
 what do I do to get ready?




                          photo credit: Fabio Venni


                                                      22

getting started
make a test


             keep it simple stupid



                                         23

Here is the simplest way to use JMeter
start JMeter




                                        24

Starting JMeter from the command-line
start a plan




                                           25

Start a new plan, give it a name
threads




                                                     26

Set up the number of threads you want to test with
request




                                          27

Add an HTTP Request to the Thread Group
Set up the server’s IP, port and path
recording




                                                                                           28

A graph for plotting results
If you are running many tests, make sure you give everything suitable names and comments
so you know what you were testing.
The test output can be written to file for further analysis.
check everything


          • content of datafeeds
          • behaviour of pipelines
          • outcome of transformations




                                                                                            29

Check every stage, so you know everything is working properly and set up as you expected.
Do this before you start testing.
Otherwise you might not be testing what you think you are.
caching


           • repository?
           • datasource?
           • pipeline?




                                                   30

Make sure you know the state of all the caching,
so it matches what you want to test.
warm-up


          • hit your test page(s) with a browser
          • last chance for a visual check
          • get Cocoon up to speed




                                                                      31

Warm-up Cocoon.
Hit the pages you want to test in a browser to make sure they work.
be local


           • clients  server on the same subnet
           • avoid possible network issues




                                                   32

Be on the server's local subnet.
enough clients?


           • creating many threads
           • creates its own overhead




                                                                33

Have enough clients to perform the level of testing you need.
quit processes


           • everything that is unnecessary
           • periodic processes skew your results




                                                                                                34

Letting something like your email client fire o periodic checks for new mail, will skew your
results.
record your data

           • server logs
           • JMeter graphs
           • JMeter data file (XML or CSV ?)
           • screen grabs of specific events
           • test it !!!!!


                                                                    35

Prepare properly, to make sure all of your data will be recorded.
Grab relevant sections of logs.
Grab graphs after a run.
Choose what data to write to a file.
running tests
       time for a cup of tea?




                           photo credit: thespeak


                                                    36

No, you have lots to do.
run-time data


           • clear log windows on each run
           • keep it organised
           • use a file or folder naming convention




                                                                                             37

Record the real-time data you need.
I clear the log windows for each run so after the run is finished, I can easily scroll back
looking for exceptions etc.
Use naming conventions for multiple runs.
watch it run

           • part of the learning process
           • see where the problems happen
           • see what you are fixing
           • make the link between cause and effect
           • take snapshots


                                                      38

Watch the tools as the tests run.
Learn to read the graphs.
my screen




                                                                 39

I can follow errors and timings change in Cocoon’s output.
Errors and query times changing for the repo, in Jetty’s logs.
Thread, memory and cpu usage in Activity Monitor.
interpreting
       the results
      what does it all mean?




                                        photo credit: woneffe


                                                                                               40

The key for me, to begin to learn how to interpret the results, was to watch the tests live,
relating what appeared on the graph to what was happening (errors, slowdowns, garbage
collection etc.) on the server.
reading the graph

    • load speed

    • throughput

    • deviation

    • hits




                                                                                         41

NB. Unless you are testing on real hardware, these speeds have no meaning in isolation
but are useful for comparison
reading the graph

     • load speed

     • throughput

     • deviation

     • hits




                                       42

Page load speeds in milliseconds.
Lower is better
On a stable system, it should go flat
reading the graph

     • load speed

     • throughput

     • deviation

     • hits




                                       43

Throughput in pages per second.
Higher is better
On a stable system, it should go flat
reading the graph

     • load speed

     • throughput

     • deviation

     • hits




                                                                44

The deviation (variability) of the load speed in milliseconds
Lower is better
On a stable system, it should go flat
reading the graph

    • load speed

    • throughput

    • deviation

    • hits




                                             45

The black dots are individual sample times
reading the graph

     • load speed

     • throughput

     • deviation

     • hits




                                                                    46

Sometimes JMeter draws data o the graph
I was using a beta, this may have been fixed in the latest release
chaotic start

           • test for long enough

              • JMeter ramps threads

              • JVMs warm up

              • Servlet adds threads




                                                                            47

Your tests need to run for long enough for you to get meaningful results.
I ran a minimum of 600 hits per test
what’s this sawtooth?


       • hysteresis?

       • randomise requests?




                                                             48

You can sometimes see a sawtooth in the throughput.
What causes this?
Is it important?
This is what I think is happening ....

Maybe you could remove the eect by randomising requests.
what’s this sawtooth?
                                               processing


       • hysteresis?

       • randomise requests?




                                                            49

Throughput slows as jobs build up and threads process.
what’s this sawtooth?


       • hysteresis?

       • randomise requests?

                                              sending



                                                        50

Responses comes in spurts as jobs complete.
JMeter issues new requests
what’s this sawtooth?


        • hysteresis?

        • randomise requests?




                                                                                   51

The change in gradient can tell you the change in the increase in throughput (?)
shi‘appen




                                                                     52

Learn to relate problems on the server to its eect on the graph.
Big spikes indicate that you have problems
You may see the eects of:
exceptions
garbage collection
good signs

        • speed flattening

        • throughput flattening

        • deviation dropping

        • no exceptions ; )




                                                           53

When the values on the graph begin to flatten out,
it shows that the system has become stable at that load.
more tests

           • authorise
           • fill in data
           • upload files
           • wrap tests in logic
           • etc. etc.


                                                       54

I used the simplest possible configuration in JMeter.
I was only hitting one url.
It does a lot more.
more protocols
           • JDBC
           • LDAP
           • FTP
           • AJP
           • JMS
           • POP, IMAP
           • etc. etc.

                                                                      55

You can apply tests to many dierent parts of your infrastructure.
conclusions
• design to cope
• test early, test often
• plan well
• pay attention
• capture everything
• maintain a model


                           56

More Related Content

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Break My Site

  • 1. a talk for CocoonGT 2007 by Jeremy Quinn Break My Site practical stress testing and tuning of Cocoon applications photo credit: Môsieur J 1 This is designed as a beginner’s talk. I am the beginner.
  • 2. scenario Original 400 350 Page Load (secs) Throughput (pages/min) 300 Stability % Approximately 600 hits per data-point 250 200 150 100 50 0 1 10 20 30 40 50 60 70 80 90 100 Users 2 My starting point for optimisation You may be able to see how useless one person clicking in a browser is at testing, the server never gets loaded. Disregard the absolute speed values, this was done on my laptop.
  • 3. scenario Original 400 350 Page Load (secs) Throughput (pages/min) 300 Stability % Average seconds per Approximately 600 hits per data-point page OUCH !!!! 250 200 150 Throughput pages per minute 100 EEEK !!! 50 0 1 10 20 30 40 50 60 70 80 90 100 Users 3 The original server configuration being taken to only 30 users, with disastrous eect. Throughput drops to single figures, page load time climbs sky high, stability reduces by nearly half. From the logs I could see there were not enough threads or memory to cope. This is badly broken.
  • 4. scenario Original accumulated optimisations 400 -–— what’s possible 350 Page Load (secs) Throughput (pages/min) 300 Stability % Approximately 600 hits per data-point All graphs at the same scale 250 Memory Thread Optimisation 200 150 100 50 0 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 Users 4 Memory and Thread optimisation has made a tremendous dierence. Now I can easily test up to 100 users, before I could not go past 30. Page Load time, Throughput etc. is now linear with the increase in users. At some point this configuration will also ‘break’, you need to know where this point is so that you can plan for it not happening.
  • 5. scenario Original accumulated optimisations 400 -–— what’s possible 350 Page Load (secs) Throughput (pages/min) 300 Stability % Approximately 600 hits per data-point All graphs at the same scale 250 Memory Thread Optimisation Read Optimisation 200 150 100 50 0 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 Users 5 The server is doing slightly less work due to this optimisation This shows as the gradients flattening out a bit more.
  • 6. scenario Original accumulated optimisations 400 -–— what’s possible 350 Page Load (secs) Throughput (pages/min) 300 Stability % Approximately 600 hits per data-point All graphs at the same scale 250 List Optimisation Memory Thread Optimisation Read Optimisation 200 200 150 150 100 100 50 50 0 0 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 1 10 20 30 40 50 60 70 80 90 100 Users 6 Another optimisation, further reducing the work done on the server. Flatter curves, better performance. This gives you an idea of the scale of improvement you may be able to make. In my case it is quite dramatic!
  • 7. purpose what do I hope to achieve? photo credit: Brian Uhreen 7 Load testing can be used to solve dierent sorts of problems. You don’t want your site broken by popularity. Find out how much trafic will make a site break, so you can plan to cope.
  • 8. comparing changes • code optimisations • different implementations • caching strategies • different datasources • different server architectures 8 Load testing can be used during development to test changes.
  • 9. test content • test the content of pages • test the behaviour of webapps 9 JMeter also has exhaustive tools for crawling and testing content within web pages. It can also send parameters as POST requests etc. to help you test webapps.
  • 10. gauge your server • get a specification • how many of what power of machine? • choosing and tuning a load-balancer 10 Before you start to work out what servers you need, you have to know what level of trafic it is intended to cope with. This has to come from either the implementation you are replacing or from marketing. Test the machines you plan to use, so you know what capacity they can handle. Round-Robins with machines of dierent capacities may work really badly.
  • 11. planning what am I going to do? photo credit: Paul Goyette 11 Plan well and hopefully you will get useful data
  • 12. what can I change? • implementations • server configuration • memory • threads • system architecture 12 What kind of changes do you want to compare?
  • 13. what will happen? • build a mental model • predict what you expect to happen • learn to read the data • test your ideas against reality 13 As your tests run, relate events in the server logs to how the graphs look
  • 14. order of change • only make one change at a time • only make one change at a time • only make one change at a time • only make one change at a time 14 If there are several changes you can make It is important to plan what order you do them in
  • 15. order of change • have you got that? 15 If you make more than one change at a time you don’t know which change had what eect which makes it more dificult to build a mental model of what is happening
  • 16. order of change • in the most meaningful order • which depends on your purpose 16 I tested optimisations before playing with threads and memory For each change, I ran the tests again. Optimisations may require dierent ideal thread and memory settings.
  • 17. what tools? on MacOSX I used : • JMeter • Terminal • Console • Activity Monitor • Grab 17 The tools I used to capture and watch real-time performance and issues
  • 18. what tools? on MacOSX I used : • JMeter • Terminal • Console • Activity Monitor • Grab 18 I found it was fine to run JMeter on the server for running low level tests. It is better to run JMeter on another machine though. For very high throughput testing, you can aggregate results from many JMeter clients.
  • 19. what tools? on MacOSX I used : • JMeter • Terminal • Console • Activity Monitor • Grab 19 I can watch Cocoon in its Terminal window. See errors as they happen
  • 20. what tools? on MacOSX I used : • JMeter • Terminal • Console • Activity Monitor • Grab 20 I used the Console to filter and watch Jetty’s logs for the repository.
  • 21. what tools? on MacOSX I used : • JMeter • Terminal • Console • Activity Monitor • Grab 21 In Activity Monitor I can track threads, memory and cpu usage. Here we can see the two java processes The top one is Cocoon, the bottom one the repository Here you can see that through bottlenecks, the system is being under-utilised. IMHO both cores should be working fully on a well tuned system
  • 22. setup what do I do to get ready? photo credit: Fabio Venni 22 getting started
  • 23. make a test keep it simple stupid 23 Here is the simplest way to use JMeter
  • 24. start JMeter 24 Starting JMeter from the command-line
  • 25. start a plan 25 Start a new plan, give it a name
  • 26. threads 26 Set up the number of threads you want to test with
  • 27. request 27 Add an HTTP Request to the Thread Group Set up the server’s IP, port and path
  • 28. recording 28 A graph for plotting results If you are running many tests, make sure you give everything suitable names and comments so you know what you were testing. The test output can be written to file for further analysis.
  • 29. check everything • content of datafeeds • behaviour of pipelines • outcome of transformations 29 Check every stage, so you know everything is working properly and set up as you expected. Do this before you start testing. Otherwise you might not be testing what you think you are.
  • 30. caching • repository? • datasource? • pipeline? 30 Make sure you know the state of all the caching, so it matches what you want to test.
  • 31. warm-up • hit your test page(s) with a browser • last chance for a visual check • get Cocoon up to speed 31 Warm-up Cocoon. Hit the pages you want to test in a browser to make sure they work.
  • 32. be local • clients server on the same subnet • avoid possible network issues 32 Be on the server's local subnet.
  • 33. enough clients? • creating many threads • creates its own overhead 33 Have enough clients to perform the level of testing you need.
  • 34. quit processes • everything that is unnecessary • periodic processes skew your results 34 Letting something like your email client fire o periodic checks for new mail, will skew your results.
  • 35. record your data • server logs • JMeter graphs • JMeter data file (XML or CSV ?) • screen grabs of specific events • test it !!!!! 35 Prepare properly, to make sure all of your data will be recorded. Grab relevant sections of logs. Grab graphs after a run. Choose what data to write to a file.
  • 36. running tests time for a cup of tea? photo credit: thespeak 36 No, you have lots to do.
  • 37. run-time data • clear log windows on each run • keep it organised • use a file or folder naming convention 37 Record the real-time data you need. I clear the log windows for each run so after the run is finished, I can easily scroll back looking for exceptions etc. Use naming conventions for multiple runs.
  • 38. watch it run • part of the learning process • see where the problems happen • see what you are fixing • make the link between cause and effect • take snapshots 38 Watch the tools as the tests run. Learn to read the graphs.
  • 39. my screen 39 I can follow errors and timings change in Cocoon’s output. Errors and query times changing for the repo, in Jetty’s logs. Thread, memory and cpu usage in Activity Monitor.
  • 40. interpreting the results what does it all mean? photo credit: woneffe 40 The key for me, to begin to learn how to interpret the results, was to watch the tests live, relating what appeared on the graph to what was happening (errors, slowdowns, garbage collection etc.) on the server.
  • 41. reading the graph • load speed • throughput • deviation • hits 41 NB. Unless you are testing on real hardware, these speeds have no meaning in isolation but are useful for comparison
  • 42. reading the graph • load speed • throughput • deviation • hits 42 Page load speeds in milliseconds. Lower is better On a stable system, it should go flat
  • 43. reading the graph • load speed • throughput • deviation • hits 43 Throughput in pages per second. Higher is better On a stable system, it should go flat
  • 44. reading the graph • load speed • throughput • deviation • hits 44 The deviation (variability) of the load speed in milliseconds Lower is better On a stable system, it should go flat
  • 45. reading the graph • load speed • throughput • deviation • hits 45 The black dots are individual sample times
  • 46. reading the graph • load speed • throughput • deviation • hits 46 Sometimes JMeter draws data o the graph I was using a beta, this may have been fixed in the latest release
  • 47. chaotic start • test for long enough • JMeter ramps threads • JVMs warm up • Servlet adds threads 47 Your tests need to run for long enough for you to get meaningful results. I ran a minimum of 600 hits per test
  • 48. what’s this sawtooth? • hysteresis? • randomise requests? 48 You can sometimes see a sawtooth in the throughput. What causes this? Is it important? This is what I think is happening .... Maybe you could remove the eect by randomising requests.
  • 49. what’s this sawtooth? processing • hysteresis? • randomise requests? 49 Throughput slows as jobs build up and threads process.
  • 50. what’s this sawtooth? • hysteresis? • randomise requests? sending 50 Responses comes in spurts as jobs complete. JMeter issues new requests
  • 51. what’s this sawtooth? • hysteresis? • randomise requests? 51 The change in gradient can tell you the change in the increase in throughput (?)
  • 52. shi‘appen 52 Learn to relate problems on the server to its eect on the graph. Big spikes indicate that you have problems You may see the eects of: exceptions garbage collection
  • 53. good signs • speed flattening • throughput flattening • deviation dropping • no exceptions ; ) 53 When the values on the graph begin to flatten out, it shows that the system has become stable at that load.
  • 54. more tests • authorise • fill in data • upload files • wrap tests in logic • etc. etc. 54 I used the simplest possible configuration in JMeter. I was only hitting one url. It does a lot more.
  • 55. more protocols • JDBC • LDAP • FTP • AJP • JMS • POP, IMAP • etc. etc. 55 You can apply tests to many dierent parts of your infrastructure.
  • 56. conclusions • design to cope • test early, test often • plan well • pay attention • capture everything • maintain a model 56