- 浏览: 2682851 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
80后的童年2:
深入浅出MongoDB应用实战开发网盘地址:https://p ...
MongoDB入门教程 -
shliujing:
楼主在不是精通java和php的前提下,请不要妄下结论。
PHP、CakePHP哪凉快哪呆着去 -
安静听歌:
希望可以一给一点点注释
MySQL存储过程之代码块、条件控制、迭代 -
qq287767957:
PHP是全宇宙最强的语言!
PHP、CakePHP哪凉快哪呆着去 -
rryymmoK:
深入浅出MongoDB应用实战开发百度网盘下载:链接:http ...
MongoDB入门教程
Note3, Finding Bottlenecks: Benchmarking and Profiling
Benchmarking and profiling are two essential practices for finding bottlenecks
A benchmark measures your system's performance. This can help determine a system's capacity, show you which changes matter and which don't, or show how your application performs with different data
Profiling helps you find where your application spends the most time or consumes the most resources
Benchmarking answers the question "How well does this perform?" and profiling answers the question "Why does it perform the way it does?"
Why Benchmark?
Benchmarks can help you do:
Measure how your application currently performs
Validate your system's scalability
Plan for growth
Test your appplication's ability to tolerate a changing environment
Test different hardware, software, and operating system ocnfigurations
Benchmarking Strategies
There are two primary benchmarking strategies: you can benchmark the appplication as a whole, or isolation MySQL
These two strategies are known as full-stack and single-component benchmarking respectively
What to measure:
Transactions per time unit, Response time or latency, Scalability, Concurrency
Benchmarking Tactics
The first step in planning a benchmark is to identify the problem and the goal
Try to record as much additional information as you can during the benchmarks, such as CPU usage, disk I/O, and network traffic statistics, counters from SHOW GLOBAL STATUS
The best way to get accurate results is to design your benchmark to answer the question you want to answer
It's usually a good idea to automate the benchmark runs
Benchmarking Tools
Full-Stack Tools:
ab
ab is a well-known Apache HTTP server benchmarking tool, it shows how many requests per second your HTTP server is capable of serving
http_load
Similar tool in concept to ab, it's also designed to load a web server, but more flexible
JMeter
A Java application that can load another application and measure its performance, much more complex
Single-Component Tools:
mysqlslap
mysqlslap simulates load on the server and reports timing information
sysbench
sysbench is a multithreaded system benchmarking tool
You can measure the performance of file I/O, the OS scheduler, memory allocation and transfer speed, POSIX threds, and the database server itself
sysben supports scription in the Lua language, which makes it very flexible for testing a variety of scenarios
Database Test Suite
a test kit for running benchmarks similar to some industry-standard benchmarks, such as those published by TPC
MySQL Benchmark Suite
MySQL's own benchmark suite, single-threaded and measure how quickly the server executes queries
Super Smack
a benchmarking, stress-testing, and load-generating tool for MySQL and PostgreSQL
It's a complex, powerful tool that lets you simulate multiple users, load test data into the database, and populate tables with randomly generated data
Benchmarking Examples
Profiling
Database access if often the bottleneck in application
Bottlenecks can also be caused by any of the following:
External resources, such as calls to web services or search engines
Operations that require processing large amounts of data in the application, such as parsing big XML files
Expensive operations in tight loops, such as abusing regular expressiosn
Badly optimized algorithms, such as naive search algorithms to find items in lists
Application profiling can help you find the bottlenecks, and it's an important step in monitoring and improving overall performance
We recommend that you include profiling code in every new project you start
Your profiling code should gather and log at least the following:
Total execution time, or "wall-clock time"(in web applications, this is the total page render time)
Each query executed, and its execution time
Each connection opened to the MySQL server
Every call to an external resource, such as web services, memcached, and externally invoked scripts
Potentially expensive function calls, such as XML parsing
User and system CPU time
MySQL has two kinds of query logs: the general log and the slow log
The general log writes out every query as the server receives it, even some events such as connecting and disconnecting and queries may not even be executed due to errors
The slow log contains only queries that have executed
In particlular, slow log logs queries that take more than a specified amount of time to execute
Log analysis tools:
mysqldumpslow
mysql_slow_log_filter
mysql_slow_log_parser
mysqlsla
SHOW STATUS/SHOW PROFILE
Operating System Profiling
netstat
vmstat
iostat
mpstat
strace
OProfile
pgrof
Intel VTune, Sun Performace Analyzer, DTrace
Benchmarking and profiling are two essential practices for finding bottlenecks
A benchmark measures your system's performance. This can help determine a system's capacity, show you which changes matter and which don't, or show how your application performs with different data
Profiling helps you find where your application spends the most time or consumes the most resources
Benchmarking answers the question "How well does this perform?" and profiling answers the question "Why does it perform the way it does?"
Why Benchmark?
Benchmarks can help you do:
Measure how your application currently performs
Validate your system's scalability
Plan for growth
Test your appplication's ability to tolerate a changing environment
Test different hardware, software, and operating system ocnfigurations
Benchmarking Strategies
There are two primary benchmarking strategies: you can benchmark the appplication as a whole, or isolation MySQL
These two strategies are known as full-stack and single-component benchmarking respectively
What to measure:
Transactions per time unit, Response time or latency, Scalability, Concurrency
Benchmarking Tactics
The first step in planning a benchmark is to identify the problem and the goal
Try to record as much additional information as you can during the benchmarks, such as CPU usage, disk I/O, and network traffic statistics, counters from SHOW GLOBAL STATUS
The best way to get accurate results is to design your benchmark to answer the question you want to answer
It's usually a good idea to automate the benchmark runs
Benchmarking Tools
Full-Stack Tools:
ab
ab is a well-known Apache HTTP server benchmarking tool, it shows how many requests per second your HTTP server is capable of serving
http_load
Similar tool in concept to ab, it's also designed to load a web server, but more flexible
JMeter
A Java application that can load another application and measure its performance, much more complex
Single-Component Tools:
mysqlslap
mysqlslap simulates load on the server and reports timing information
sysbench
sysbench is a multithreaded system benchmarking tool
You can measure the performance of file I/O, the OS scheduler, memory allocation and transfer speed, POSIX threds, and the database server itself
sysben supports scription in the Lua language, which makes it very flexible for testing a variety of scenarios
Database Test Suite
a test kit for running benchmarks similar to some industry-standard benchmarks, such as those published by TPC
MySQL Benchmark Suite
MySQL's own benchmark suite, single-threaded and measure how quickly the server executes queries
Super Smack
a benchmarking, stress-testing, and load-generating tool for MySQL and PostgreSQL
It's a complex, powerful tool that lets you simulate multiple users, load test data into the database, and populate tables with randomly generated data
Benchmarking Examples
$ http_load -parallel 1 -seconds 10 urls.txt $ http_load -paraleel 5 -seconds 10 urls.txt $ http_load -rate 5 -seconds 10 urls.txt $ http_load -rate 20 -seconds 10 urls.txt $ sysbench --test=cpu --cpu-max-prime=20000 run $ sysbench --test=fileio --file-total-size=150G prepare $ sysbench --test=fileio --file-total-size=150G --file-test-mode=rndrw --init-rnd=on --max-time=300 --max-requests=0 run $ sysbench --test=fileio --file-total-size=150G cleanup $ sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root prepare $ sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run sql-bench$ ./run-all-tests --server=mysql --user=root --log --fast sql-bench$ ./test-insert
Profiling
Database access if often the bottleneck in application
Bottlenecks can also be caused by any of the following:
External resources, such as calls to web services or search engines
Operations that require processing large amounts of data in the application, such as parsing big XML files
Expensive operations in tight loops, such as abusing regular expressiosn
Badly optimized algorithms, such as naive search algorithms to find items in lists
Application profiling can help you find the bottlenecks, and it's an important step in monitoring and improving overall performance
We recommend that you include profiling code in every new project you start
Your profiling code should gather and log at least the following:
Total execution time, or "wall-clock time"(in web applications, this is the total page render time)
Each query executed, and its execution time
Each connection opened to the MySQL server
Every call to an external resource, such as web services, memcached, and externally invoked scripts
Potentially expensive function calls, such as XML parsing
User and system CPU time
MySQL has two kinds of query logs: the general log and the slow log
The general log writes out every query as the server receives it, even some events such as connecting and disconnecting and queries may not even be executed due to errors
log = <file_name>
The slow log contains only queries that have executed
In particlular, slow log logs queries that take more than a specified amount of time to execute
log-slow-queries = <file_name> long_query_time = 2 log-queries-not-using-indexex log-slow-admin-statements
Log analysis tools:
mysqldumpslow
mysql_slow_log_filter
mysql_slow_log_parser
mysqlsla
SHOW STATUS/SHOW PROFILE
Operating System Profiling
netstat
vmstat
iostat
mpstat
strace
OProfile
pgrof
Intel VTune, Sun Performace Analyzer, DTrace
评论
1 楼
hideto
2009-07-02
FW也是在Rails程序里有Profiling相关的代码的,每天发一个TOP 20 slow urls和TOP 20 slow queries的report出来。其实这个可以做成一个通用的插件的,不知道有没有现成的
发表评论
-
HPM Note5, Query Performance Optimization
2009-07-21 18:05 1482Slow Query Basics: Optimize Dat ... -
HPM Note4, Schema Optimization and Indexing
2009-07-16 18:04 1487Choosing Optimal Data Types Sma ... -
HPM Note2, MySQL Architecture
2009-06-30 17:13 1763MySQL's Logical Architecture Th ... -
HPM Note1,Book Organization
2009-06-23 09:49 1636How This Book Is Organization ... -
MySQL Architecture
2009-01-18 00:12 3105MySQL Core Modules: Server In ... -
MySQL优化笔记
2008-10-28 17:59 3489MySQL 5.1参考手册 :: 7. 优化 一、查询优化 ... -
MySQL里获取当前week、month、quarter的start_date/end_date
2008-10-21 14:14 7460当前week的第一天: select date_sub(cur ... -
mysql里找出一个表的主键被谁作为外键约束
2008-08-13 17:16 2187SELECT ke.referenced_table_n ... -
SQL性能调优:2.1 排序的一般性调优
2008-08-05 10:21 3576影响排序速度的原因(从大到小): 1,选择的行数 2,ORDE ... -
TCP-IP详解笔记1.5 RARP:逆地址解析协议
2008-07-25 14:05 2281from http://www.beyondrails.com ... -
SQL性能调优:1.3 其他语法调优
2008-07-25 13:38 1390from http://www.beyondrails.com ... -
SQL性能调优:1.2 特别语法调优
2008-07-24 12:15 2705from http://www.beyondrails.com ... -
SQL性能调优:1.1 一般性语法调优
2008-07-23 14:47 2542from http://www.beyondrails.com ... -
MySQL存储程序开发最佳实践
2008-05-28 13:56 1692MySQL存储程序开发最佳 ... -
MySQL join的文章
2008-05-28 13:00 1569MySQL的联结(Join)语法 -
MySQL索引系列文章
2008-05-28 12:51 1473MySQL索引使用 MySQL索引 MySQL 5.1参考手册 ... -
MySQL存储程序权限控制
2008-05-28 12:29 1406MySQL存储程序权限控制 MySQL5.0引入了一些管理存 ... -
MySQL的Stored Function和Trigger
2008-05-27 18:58 3131MySQL的Stored Function和Trigger ... -
MySQL内建Function
2008-05-22 17:25 6548MySQL内建Function 在MySQL存储程序(存储过 ... -
MySQL存储过程之事务管理
2008-05-21 14:36 44947MySQL存储过程之事务管理 ACID:Atomic、Con ...
相关推荐
HPM6700/6400 系列微控制器是基于 RISC-V 内核的 32 位高性能微控制器,适用于上海先楫半导体科技有限公司以下型号产品:HPM6750IVM1、HPM6750IAN1、HPM6730IVM1、HPM6730IAN1、HPM6450IVM1、HPM6450IAN1、HPM6430...
3. pnp:即“Plug and Play”(即插即用),意味着该驱动支持Windows操作系统中的自动识别和配置设备功能。 4. win2kxp:表示该驱动程序兼容Windows 2000和Windows XP操作系统,说明这是一个较老版本的驱动,可能不...
上海先楫HPM6750是一款高性能的嵌入式微处理器,专为处理复杂的多媒体应用而设计。这款芯片在物联网(IoT)、智能硬件、工业自动化等领域有着广泛的应用。HPM6450是其系列中的另一款处理器,虽然可能在性能上有所区别...
《HPM.1硬件平台管理:IPM控制器固件升级规范》 HPM.1(Hardware Platform Management)是PICMG(PCI工业计算机制造商集团)发布的一项标准,旨在规范服务器和其他计算平台的硬件平台管理,特别是关于IPM...
上海先楫HPM6750驱动EMMC和SD卡的开发是嵌入式系统设计中的关键环节,尤其对于基于HPM6750和HPM6450处理器的设备来说,高效的存储器管理是确保系统性能和稳定性的基础。这个代码工程提供了一个完整的解决方案,使...
HPM1210.INF
【标题】"hpm1210sd.rar"是一个压缩文件,通常用于在互联网上分享或存储多个相关文件。从这个名字来看,它可能是某个特定硬件设备、软件程序或者相关项目的一部分,具体而言,"HPM1210SD"可能代表一个型号、版本号...
《TDC 3000系统HPM组态手册》是针对HONEYWELL公司旗下的TDC 3000控制系统的一份详细指南,主要涵盖了该系统的模块配置和设定,尤其适用于石化行业的分布式控制系统(DCS)应用。在这个高度集成且复杂的自动化系统中...
HPM1210SU.ent HPM1210SU.ent HPM1210SU.ent
HPM1210SM.exe
HPM1210SU.VER
标题中的"HPM.rar_ZIY_hpm"表明这是一个关于HPM(可能是Hercules Performance Monitor)的压缩文件,由用户ZIY创建或整理,主要用于HercWS(可能是指Hercules Web Services)。"ziy hpm"的标签进一步确认了这个文件...
描述中的“win7可以使用”确认了HP LaserJet M1005打印机在Windows 7系统上是支持的,并且提到了“hpm10005win7的驱动”,这可能是描述中的一个小错误,应该是指“hpm1005win7”的驱动,即对应的是HP LaserJet M1005...
HPM1210PP.dll
HPM1210GC.DLL
HPM1210FPSD.DLL
上海先楫HPM6750驱动LCD屏上显示内容的工程是专为HPM6750和HPM6450处理器设计的。这个项目的核心在于如何有效地利用这两款处理器的特性来控制和显示LCD屏幕上的信息。在嵌入式系统中,这种驱动程序的开发对于实现人...
适用于XP32位操作系统的HPm1005打印机驱动
在本文中,我们将深入探讨如何使用上海先楫的HPM6750和HPM6450处理器实现CAN(Controller Area Network)和CAN-FD(Controller Area Network with Flexible Data-rate)通信。这两种通信协议在嵌入式系统,尤其是...
HPM.1 Firmware Update Open Compute Summit - Compute Summit HPM.1 Firmware Update Engineering Workshop HPM.1 File Format File is not sent as a single image Each action is sent by itself to IPM ...