Third, the service system capacity assessment and performance guarantees

First, the architecture design and non-functional quality

Architecture design: architecture software architecture design methodology in general will be divided into three stages

Needs analysis and finishing:

  • Sort all use cases and scenarios, and abstract user and object-oriented system, the combing function for each user role and should provide the needs of the non-functional requirements and limitations.
  • Non-functional requirements include: high availability, high performance, scalable, expandable, etc.
  • Then on functional requirements and non-functional requirements to sort, identify the core needs and characteristics of demand
  • Finally, the core needs and characteristics of demand as a fundamental to expand the architecture design.

Outline design

  • The whole system is divided into modules, and define the relationships and interactions between the good module.

detailed design

  • The method generally used to describe a multi-view system architecture, the multi-view comprising: a data view, view logic, the development view, process view, physical view, view properties, safety and the like view.

Internet Architecture Tradeoff Analysis Method (Architecture Tradeoff Analysis Method, ATAM) is a comprehensive evaluation of software architecture and comprehensive approach, not only reveal the architecture to meet the specific case of quality targets, and can make us more aware of the quality of the target constraints and trade-offs between. Before the project can be implemented assessment framework methodology is able to meet these non-functional quality.

Second, the overall quality of non-functional requirements

Overview:

Core non-functional quality indicators

  • High performance: high efficiency, high cost
  • Availability: continuous availability, reduce downtime, error recovery, reliability
  • Scalability: vertical scaling, horizontal scaling
  • Scalability: pluggable, reusable components
  • Security: data security, encryption, fuse, anti-attack

Other non-functional quality indicators

  • It can be monitored: the rapid discovery, locate and resolve
  • Testability: gradation can be preview Mock can be disassembled
  • Robustness: fault tolerance, recoverability
  • Maintainability: ease of maintenance, monitoring, operation and expansion
  • Reusability: portability, decoupling
  • Ease of use: operational

Specific indicators

application server

  • Deployment structure indicators: load balancing strategy, high availability strategy, IO model (NIO / BIO), thread pool model, the number of threads, business mixed deployment
  • Capacity and performance: the amount of request / day, access to the peak of each interface, an average request response time, maximum request response time, online subscribers, the requested size, the card I / O traffic, the disk I / O load , usage, memory usage, CPU's
  • Other relevant indicators: whether the content of the request contains large objects, GC collector selection and configuration

database

  • Deployment structure indicators: a replication policy, failover, disaster recovery strategy, archiving strategy, separate read and write strategies, sub-library sub-table (fragmentation) strategy, static and semi-static data whether the cache, the cache have not considered penetrate and pressure case of collapse of the database, the data cache miss and cache warm-up strategy
  • Capacity and performance indicators: current data capacity, the daily incremental data (estimated capacity), the peak per second read and write per second peak, peak transactions per second
  • Other relevant indicators: check whether taking the index, there is no large amount of data queries and range queries, there is no multi-table association, the association whether to use the index, there is no use pessimistic locking, can be transformed into optimistic locking, can use the built-in database row-level locking, and transaction-level consistency, JDBC data source type and number of connections used by other configurations, whether to open diagnostic log JDBC, there is no stored procedures, stretching strategy (partition table, the natural time-table, the level of sub-library sub-table) , the level of sub-library sub-table implementation (client, agents, NoSQL)

Cache

  • Deployment structure indicators: replication model, failover, persistent policy, elimination strategy, threading model, preheat method, hash partitioning strategy
  • Capacity and performance indicators: size, number, expiration time, cache data structures, read peaks per second of cached content, write per second peak
  • Other relevant indicators: the proportion of hot and cold data, the cache may occur if there is penetration, whether there are large objects, whether to use a distributed cache to achieve lock, whether to use the cache support scripting (LUA), whether to avoid the Race Condition, cache slicing method (client, agents, cluster)

message queue

  • Deployment structure indicators: replication model, failover, persistent policy
  • Capacity and performance indicators: average daily incremental data, message persistence of the expiration time, the peak per second read and write per second peak, the size of each message, the average delay, maximum delay
  • Other relevant indicators: Reliable delivery of consumer thread pool model, hash partitioning strategy, message, processes and consumer durable mechanism

Third, the typical outline of the technical evaluation

status quo

  • Business background: project name, business description
  • BACKGROUND ART: architectural description, the current capacity of the system, the amount of peak current system calls, the maximum and minimum request response time
    ### needs
  • The new content needs to be modified to achieve: the business requirements
  • Performance requirements: The estimated system capacity, peak estimate the amount of system calls, the maximum and minimum request response time, other non-functional quality (security, scalability, etc.)

Program Description

  • Overview: sentence highlights programs, such as: double the migration, from the main separating, library sub-table, expansion, archiving, and transformation of the interface
    details: middleware architecture, the logical schema, data schema, exception handling, DR strategy, gray publish, on-line programs, such as rollback program
    performance evaluation: the amount of concurrent single, stand-alone capacity, single peak throughput, the number of estimated resources, scalable way, the number of resources you want to use
    the advantages and disadvantages of the program: list program the pros and cons, advantages and disadvantages to have certainty, to quantify and have clear objectives and results

Scheme comparison

  • Choice Intention program, and gives reasons for choosing this scheme

Risk assessment

  • The risk of identifying the selected program proposed coping strategies when this risk occurs, for example when the rollback policy failure on the line

Workload assessment

  • Need to do when using the selected program specific job description and evaluation time to develop, test and other tasks needed refinement to form task schedule can be implemented, the schedule is generally assigned two staff from the perspective of project plans and to manage projects recommended simple Excel table, to reduce the use and cost of the tool curve and learning.

Fourth, the performance and capacity assessment

The order of evaluation criteria:

Common Criteria

  • Capacity: redundancy calculated as 5 times the peak
  • Common capacity of the user's address: calculated as 30 years
  • Order data stream capacity: timeliness is strong, calculated in accordance with 3 years
  • Third-party logistics query interface: throughput of 5000 / s

MySQL:

  • Single-port reading: 1000 / s
  • Single-port write: 1000 / s
  • Single table capacity: 50 million

Redis:

  • Single-port reading: 40000 / s
  • Single-port write: 40000 / s
  • Single-Port Memory capacity: 32GB

Kafka:

Single Read: 30000 / s
single write: 5000 / s
application server: the amount of requests peak: 5000 / s

V. Reference Standard Performance Evaluation

Common application layer performance reference standard (PC X86 desktop machines using empirical value)

Common Criteria:

  • Capacity is calculated five times redundancy peak
  • Capacity after the sub-table 30 may store a general sub-library of data
  • Third-party query interface throughput of 5000 / s
  • A single database record about 1KB of space

MySQL

  • Single-port reading: 1000 / s
  • Single-port write: 1000 / s
  • Single table capacity: 50 million

Redis

  • Single-port reading: 40000 / s
  • Single-port write: 40000 / s
  • Single-Port Memory capacity: 32GB

Kafka

  • Single Read: 30000 / s
  • Stand-alone write: 5000 / s

DB2

  • Single read peaks: 20000 / s
  • Stand-alone write Peak: 20000 / s
  • Single table Capacity: 100000000 Data

Common system performance reference standard

Registers and memory

  • Register, L2, L3, a memory, a branch prediction fails, the mutex to lock and unlock, etc. Processed nanosecond
  • Random access memory up to 30 million times / s, sequential reads up to 500 million times / s
  • GB-level data can be read per second memory
  • 1MB memory read data is 250ns, for the sub-millisecond

Disk I / O

  • SATA conventional mechanical hard IOPS can reach 120 times / s

Design and Practice of six performance test program

slightly

Seven, a useful tool for pressure measurement

  • ab: tools for performance measurement of pressure for the HTTP service implementation can be used to test the performance of all generic HTTP server
  • jmeter: apache java-based performance stress testing tool for java development software to do the stress test, can be used to test static and dynamic resources; can be used for a huge load on the server, network or object simulation, pressure in different categories test their strength and overall performance analysis, you can also do functional testing and regression testing of applications, it allows the use of regular expressions to create suggestions
  • mysqlslap: MySQL is the pressure that comes with a performance measurement tool, by simulating multiple concurrent access MySQL client to perform stress tests, while providing detailed performance data reports. This tool can automatically generate test data and tables, and may be an analog read, write, write mixed, query different usage scenarios, it is possible to compare a plurality of storage engine performance difference at the same pressure environment concurrent well.
  • sysbench: is an open source multi-threaded performance testing tool, performance testing can be performed on the CPU / memory / thread / IO / databases.
  • dd: it can be used to test the disk access speed sequential I / O's. In the scenario, the print log writes usually presents sequential I / O, the second database queries are mostly random disk I / O.
  • LoadRunner: HP is a commercial performance testing tool, by simulating thousands of users simultaneously high concurrent load on the target system, and the use of real-time detection of system resources and performance of performance indicators and other ways to find and locate the problem , is a professional performance and load stress testing tools, application and test any type of application, and has a simple-to-use, full-featured and supports interactive testing of UI and so on.
  • hprof: JDk own command analysis heap memory and CPU usage line tool, in fact, hprof is not an executable command, but a JVM perform dynamic loading of native libraries agent, run after loading the JVM process by configuring different options when the JVM starts, allowing hprof monitor different performance indicators, including heap, CPU usage, thread stack and so on. hprof generates a binary or text file format output, the output of the binary format can use the command-line tool to analyze HAT, developers can identify performance bottlenecks by analyzing the output file.
Published 18 original articles · won praise 1 · views 168

Guess you like

Origin blog.csdn.net/qq_33670157/article/details/104569059