How to do load testing with jmeter and visualVM?

I want to do load testing for 10 million users for my site. The site is a Java-based web application. My approach is to create a Jmeter test plan for all links and then accept a report for 10 million users. Then use jvisualVM for profiling and check for any bottlenecks.

Is there a better way to do this? Is there a demo for this? I am doing this for the first time, so any help would be very helpful.

+6
source share
5 answers

I wrote a blog as I continued the performance test:

  • Make sure that the server (the hardware can meet the requirements of production / installation) does not have other settings that can affect performance.
  • You can use the procedure to configure users in the database and it can be called part of the jmeter testing plan.
  • Install jmeter on a separate machine so that jmeter does not affect performance.
  • Create a test plan in jmeter (as shown in Figure 1) for all uri settings, with response verification and timer-based requests.
  • Take the original test using jmeter.
  • Check for low performance. These are points waiting for bottlenecks.
  • Try a variety of performance improvements, but focus only on one bottleneck.
  • Try any fix from step 6, and then run the test. If there is any improvement, commit the changes and repeat from step 5. Otherwise, go back and try the other options from step 6.
  • The next step will be to use load balancing, hardware scaling, clustering, etc. This may include some physical settings and hardware / software costs. Give results with scalability options.

Detailed explanation: http://www.daemonthread.com/2011/06/site-performance-tuning-using-jmeter.html

0
source

You are on the right track, but your load limit is high.

Why I say that this is because your site will probably need more computers to work with 10Milj concurrent users. One process is likely to struggle with simultaneous 32-channel TCP streams. Also do some of the bandwidth math you need to actually handle 10Milj users.

Now I don’t know what service you plan to provide on your site, but, thinking that JVisualVM slows down processing by 10 times (or more for method tracing), you would not actually measure the β€œreal world” "if you have JMeter and JVisualVM to work at the same time.

JVisualVM is more useful when you run lower loads.

To create a good measurement, first make sure you have a good baseline. Conduct a test with 10 concurrent users, plug in JVisuamVM and let it work for a while, and not all interesting values.

Once you have a basic level, you can start adding more workload. Add 10 times the load (ea: 100 users), look at the changes in JVisualVM. Continue this until it becomes apparent that JVisualVM is slowing you down by adding extra load each time, make sure you write down the numbers that interest you. Draw the numbers on the graph.

Now ... Interpolate the graph (manually) by the number of users you want. This works for memory usage, disk access, etc., but not CPU time, because JVisualVM will consume the processor and give you invalid numbers (especially if you have method tracing enabled).

If you really want to reach level 10Milj, I would not trust JMeter either, I would write a small test program of my own that will perform the required test. It will be okey, since setting up a site for 10Milj processing will also take time, so spending a little extra time on test tools is not a waste of time.

+3
source

Just because you have 10 million users in the database does not mean that you need to download the test using this many users. Think about it - will your site really have 10 million concurrent users? For web applications, the ratio of 1: 100 registered users is common, that is, you are unlikely to have more than 100 thousand users at any time.

Can JMeter handle this kind of load? I doubt it. Try faban instead . It is very lightweight and can support thousands of users in one virtual machine. In addition, you can significantly increase the flexibility to create your own workload, and you can also automate monitoring of your entire test infrastructure.

Now to the analysis part. You did not say which server you used. Any Java application server will provide sufficient monitoring support. Commercial servers provide convenient GUI tools, and Tomcat provides advanced monitoring through JMX. You can start here before moving on to the JVM level.

For the JVM, you really don't want to use VisualVM when doing such a big performance test. Also, to support such a load, I assume that you are using multiple instances of appserver / JVM. The main performance issue is usually the GC, so use the JVM parameters to collect and log GC information. You will need to perform post-processing of the data.

This non-trivial exercise is luck!

+3
source

There are two types of load testing - identification and bandwidth bottlenecks. This question makes me think that this is due to bottlenecks, so the number of users is something like a red herring, instead the goal for this configuration is to find areas that can be improved to increase concurrency.

Application bottlenecks typically fall into three categories: database, memory leak, or slow algorithm. Their detection is due to the fact that the application is subject to discussion under voltage (i.e. load) for a long period of time - at least an hour, possibly up to several days. Jmeter is a good tool for this purpose. One of the things to consider is to run the same tests with cookies enabled (i.e., Jmeter saves cookies and sends with each subsequent request) and is disabled - sometimes you get very different results, and this is important, because the latter is effective mimics what some crawlers do to your site. The following are bottleneck detection information:

Database

Tables without indexes or SQL statements that contain multiple joins are frequent application bottlenecks. Every database server I came across, MySQL, SQL Server and Oracle has some way to register or identify slow SQL statements. MySQL has a slow query log, while SQL Server has dynamic management views that track the slowest SQL. Once you have mastered the slow statements, use an explanation plan to see what it is trying to use the database engine to use any functions that offer indexes, and consider other strategies such as denormalization - if these two options do not solve the bottleneck,

Memory leak

Include a detailed garbage collection log and a JMX monitoring port. Then use jConsole, which provides much better graphs to observe trends. In particular, leaks usually appear as filling the spaces of the old general or Perm. Leaks are a bottleneck as the JVM spends more and more time trying to collect garbage unsuccessfully until an OOM error is thrown.

Perm Gen implies the need for more space as a command-line option for the JVM. Whereas Old Gen implies a leak, where you have to stop the load test, create a bunch of heaps, and then use the Eclipse memory analysis tool to identify the leak.

Slow algorithm

This is harder to track. The most common intruders are synchronization, interprocess communication (for example, RMI, web services) and disk I / O. Another common problem is code using nested loops (see mom O (n ^ 2)!).

The best way I found out that these problems are missing is that deeper knowledge generates stack traces. They will tell you what all the threads are doing at a given time. What you are looking for are BLOCKED threads or multiple threads accessing the same code. This usually indicates some slowness within the code base.

+3
source

I started using JMeter plugins .
This allows me to collect application metrics available through JMX for use in my load test.

0
source

Source: https://habr.com/ru/post/885793/


All Articles