Location>code7788 >text

Performance Testing Interview Questions Revealed and How to Get a Quick Offer!

Popularity:947 ℃/2024-08-09 21:09:07

 

 

Selected Performance Testing Interview Questions

 

1、 Have you done performance testing before? Please specify the process of performance testing with examples

Interview Examination Points:Flow of Performance Testing

 

  1. The first choice is to do a requirement analysis of performance testing to define the objectives, scope, scenarios, and performance metrics (e.g., response time, throughput, number of concurrent users, etc.) of performance testing.

     

  2. Test performance test environment setup: build a test environment that is as consistent as possible with the production environment, including hardware, network, operating system, database and so on.

     

  3. Choose a tool to write performance test test scripts, we use the Jmeter tool to write performance test scripts based on test scenarios that simulate user behavior and data interactions.

     

  4. Performance Test Execution: Use CLI command line to execute scripts and distributed pressure testing, including load testing, stress testing, stability testing, etc.

     

  5. Performance Test Results Analysis: Collect and analyze test results to identify performance bottlenecks and potential problems.

     

  6. Performance tuning: According to the analysis results for performance tuning, optimize the system configuration, code implementation, etc..

     

  7. Test Report Writing: Write performance test reports to summarize test results, analyze performance bottlenecks, and make optimization suggestions.

     

 

 

2、 Single computer Jmeter can send the maximum concurrency?JMeter distributed environment how to build?

Interview Examination Points:distributed pressure testing

 

(1) single-computer pressure test concurrency is affected by a number of factors, such as machine configuration (such as CPU, memory), network bandwidth, JMeter's own resource constraints, as well as the design of the test scripts, a single computer to use JMeter for concurrent testing to maximize the amount of concurrency that can be supported between a few hundred to a few thousand varies. Our previous company is more than 300 on the can not go, need to use distributed to perform.

 

2) How to build JMeter distributed environment?

 

  • Ready to assist the machine and the main controller: all the main controller and assist the machine must be wired to connect to the network, the same LAN; and all installed the same version of the jdk and Jmeter tools

     

  • Assist Machine Configuration:

    • Modify Jmeter's configuration file:, remove authentication =true Do not use encrypted authentication to transmit data;

       

  • Master Configuration:

     

    • Modify Jmeter's configuration file:, remove authentication:=true, remote_hosts=helper machine ip:port , if there is more than one helper machine information separated by commas ;

       

  • Start the helper machine: . /jmeter-server -= IP address of the helper machine.

     

 

3、What are the indicators for performance testing? Is there software that specializes in looking at performance metrics?

Examination point:Analyzing and monitoring performance test results

 

1) Performance testing metrics include:

 

  • Business metrics are: number of concurrent users, response time, TPS\QPS\RPS\HPS\throughput\throughput rate, error rate;

     

  • System resource metrics: CPU, Memory, Disk IO, Network IO, Thread Pool, JDBC Connection Pool, JVM Memory (GC /FGC/YGC Stack), and so on.

     

2) Is there software that specializes in looking at performance metrics?

 

Our company has a specially built performance monitoring platform, such as monitoring system resource indicators: prometheus + grafana + export, you can look at the CPU memory disk network and other indicators; and can be persistent storage; monitoring business indicators: influxdb + grafana + Jmeter, you can persistently store TPS ERR concurrent user number and other business indicators.

 

 

4. If you are testing the performance of an e-commerce site, how do you determine and set the appropriate number of concurrent users?

 

Examination point:Concurrency test and load test execution

 

  • (1) If it is an old project that has been online, you can confirm the number of concurrent users based on historical user data to assess, for example, peak users, the number of online users with the principle of two or eight to calculate the number of concurrent users;

     

  • (2) If the new project does not have historical data, load test [step pressure test], according to the expected number of users and behavior, gradually increase the number of concurrent users, while monitoring the system's performance indicators, in order to determine the maximum number of concurrent users that the system can withstand the upper limit; mark the number of concurrent users for the appropriate number of concurrent users, the later performance test will use this number of concurrent users for testing. The main indicators of concern are:

    • Consecutive errors before the number of concurrent users

    • Average response time exceeds expected range

    • Server resource utilization exceeded 80 per cent

       

 

5、Pressure test in the process of TPS can not be increased with the increase in the number of concurrency, the CPU also can not go up, what are the possible reasons?

 

Examination point:Analysis and tuning of performance tests

 

  • 1) Hardware resource limitations

    • Underutilized CPU resources, e.g., although the CPU usage is not high, it may not be able to handle more concurrent requests due to hardware performance bottlenecks (e.g., lack of performance of a single core or limitations on the number of CPU cores)

    • Insufficient memory or disk I/O performance bottlenecks may also affect TPS. When the system memory is insufficient, page swaps are performed frequently, resulting in a decrease in processing speed. Insufficient disk I/O performance can cause delays in database read and write operations, which in turn affects TPS

       

  • 2) Software and configuration issues

    • If the maximum number of connections in the database connection pool or the server thread connection pool is set too low, or if connections in the connection pool are not released in a timely manner, this can lead to requests waiting for connections in highly concurrent situations, which can affect TPS

    • For systems using languages such as Java, frequent garbage collection (GC) can take up CPU resources, resulting in slower system response. If the GC is not set properly or the memory allocation is not reasonable, it may result in the CPU utilization not being high but the TPS cannot be improved

    • Inefficient database queries, unreasonable indexes, unoptimized SQL statements, etc. can all lead to slower database processing, which in turn affects TPS. in addition, database lock conflicts, master-slave synchronization delays, etc. can also lead to TPS degradation

       

  • 3) Network problems

    • Network bandwidth limitation: If the network bandwidth is insufficient or the network latency is high, the data transmission speed will be affected, resulting in longer request processing time, which in turn affects the TPS

    • Network configuration issues: such as improper choice of network protocols, unreasonable network congestion control mechanisms, etc. may affect network performance, which in turn affects the TPS

       

  • 4) Application problems:

    • Code Logic Problems: Inefficiencies, dead loops, resource contention, etc. in an application can lead to a reduction in concurrency.

    • Improper caching policy: An unreasonable caching policy (e.g., low cache hit rate, improper cache expiration policy, etc.) can cause the system to frequently access databases or other slow resources, thus affecting TPS.

       

  • 5) Pressure testing tools and environmental issues:

    • Improper configuration of the pressure testing tool: The concurrency setting of the pressure testing tool is too low, and the request interval is unreasonable, etc. may lead to unstable TPS performance. In addition, if there is a performance bottleneck or configuration problem in the pressure testing tool itself, it may also affect the test results.

    • Differences in test environments: Differences between test environments and production environments (e.g., hardware configurations, network configurations, software versions, etc.) may lead to inaccurate test results. Therefore, you should try to simulate the production environment as much as possible to get more accurate test results during the pressure test.

       

 

6. For example, if 100 users log in at the same time, how do you test it?

 

I'm using the Jmeter tool for scripting and csv parameterization for 100 simultaneous user logins:

 

1) First create a txt file / or CSV file locally, enter 100 sets of usernames and passwords (comma-separated), parameterize the usernames and passwords

 

2) Create a thread group in Jmeter, set the number of threads to 100 users concurrently, execute in 1 second and loop once

 

3) Create a CSV data set config component that references a local txt/csv file

 

4) create http request, fill in the login interface parameter information, and speak user name and password information for csv parameter call;

 

5) Create a synchronization timer and set 100 users to execute concurrently for 1 second.

 

 

 

7、 What is the difference between tps and qps in performance testing?

 

  • QPS [Queries Per Second] is the number of queries a server is able to respond to per second, and is a measure of how much traffic a particular querying server handles in a specified period of time.

  • TPS [TransactionsPerSecond] The number of transactions per second, which is the unit of measurement for software test results. A transaction is the process by which a client sends a request to a server and the server responds. The client starts counting when it sends the request and ends counting when it receives a response from the server, thus calculating the time used and the number of completed transactions.

     

Tps, the number of transactions processed per second, includes the

  • 1) User request server

  • 2) Server's own internal query and other processing

  • 3) The server returns to the user

     

These three processes are capable of accomplishing N of these three processes per second, and Tps is N;

 

QPS is basically similar to TPS, but the difference is that a single visit to a page forms a TPS; however, a single page request may generate multiple requests to the server, and the server can count these requests as QPS. So, QPS >= TPS.

 

 

 

8, jmeter recording scripts have understanding?

 

There is an understanding that Jmeter can be used : non-configuration components > http proxy server to record scripts; configure a local proxy : 127.0.0.1 and the port with Jmeter's proxy port is consistent, you can record scripts.

 

However, we rarely use recorded scripts and basically write our own scripts because recorded scripts have a lot of garbage messages and do a lot of filtering and modification.

 

 

 

9, how to protect the performance of Jmeter tool side

1) Disable all listeners when executing performance tests;

2) Scripts that can be written without assertions;

3) Performance scripts are as simple as possible, do not write scripts with complex logic;

4) Use as few components as you can; no beanshell components, bad performance;

5) Try not to use timer components;

 

 

10、Performance testing and monitoring tool nmon installation and use?

 

  • Installation: Before using nmon to monitor the resources of linux server, we need to check the version of linux, and then download the nmon software that supports the corresponding version, and then, unzip the package on the linux server, you can use it.

     

  • nmon has three modes of operation, screen interaction mode, data collection mode and timed task mode;

    • When monitoring server resource usage during daily performance testing, it is common to use data collection modes such as. /nmon_x86_64_centos7 -f -s3 -c10 will be collected every 3 seconds, 10 times, and the results will be standardized to an nmon file with the name of the machine_year, month, day, and hour.

    • Then you can take the file out and parse it with the nmon analysis client to get detailed performance monitoring results for performance results analysis.

       

 

11. What is a system bottleneck?

 

Bottleneck is mainly a system of one aspect or several aspects of the ability to meet the user's specific business requirements, strictly from a technical point of view, all systems will have a bottleneck, because most of the system's resource allocation is not fully coordinated, for example, CPU utilization rate just reached 100%, the memory also happens to run out of systems is not very common. Therefore, we should discuss the system bottleneck from the application point of view, the key is to see whether the system can meet the user's needs. In the case of the user's extreme use of the system, the system's response is still normal, we can think that the system does not have a bottleneck or bottleneck will not affect the user's work.

 

Therefore, we test system bottlenecks to achieve the following two main purposes:

 

  • Discovering "surface" bottlenecks. This is the basic goal of performance testing, which is to simulate the user's operation, find out the bottlenecks in the user's extreme use of the system, and then solve the bottlenecks.

  • Discover potential bottlenecks and solve them to ensure the long-term stability of the system. The main consideration is that when the user expands the system in the future or the business changes, the system can adapt to the changes.

     

 

12. Have you been involved in performance analysis and what do you need to look at?

 

Those who have been involved in analyzing performance results have focused on the following points:

 

1) Indicators of performance:

  • Response time: is to meet the requirements, our company requirements is the average response time is less than 1.5s;

  • Throughput TPS: Whether it can increase with the number of users and reach a value that meets the needs of the project;

  • Resource Usage: Includes the usage of resources such as CPU, memory, disk and network, which generally cannot exceed 80%;

    • It can be viewed with some Linux analysis commands such as top vmstat

    • Our company also has some monitoring platforms: prometheus + grafana collects and counts resource usage of servers.

       

  • Error rate: generally less than 0.1%, there can be no continuous error reporting to ensure the stability and robustness of the system.

     

(2) Through the analysis of these indicators, found anomalies, and then through the logs, arthas, MAT and other such analytical tools to specifically analyze the causes of performance problems, such as code problems, database problems, network problems or middleware problems, and then go to the optimization in turn.

 

 

 

summarize

 

The above is the recent feedback from some students about the high frequency of performance testing interviews and reference answers. You need to combine these points with the actual cases and scenarios of the projects you have done to organize your own language to get the offer!