The impact of I/O on APP performance

1. The impact of disk I/O on APP performance

There are three main types: delay increase, ANR, random freeze

 

2. There are three existing disk I/O test tools

1、Strict Mode

StrictMode means strict mode and is a developer tool used to detect violations in programs. The most common scenario is to detect time-consuming operations such as local disk and network reads and writes in the main thread.

Disadvantage: Unable to detect subthreaded disk I/O

2 、 Systrace

Systrace is a new performance data sampling and analysis tool in Android 4.1. It can help developers to collect the running information of Android key subsystems (such as surfaceflinger, WindowManagerService and other key framework modules, services, View systems, etc.), so as to help developers more intuitively analyze system bottlenecks and improve performance. Systrace's functions include tracking system I/O operations, kernel work queues, CPU load, and the health of Android's various subsystems.

Disadvantages: The positioning problem is troublesome and the problem is single, and the available models are limited (only supported on Android 4.1+, non-native ROMs such as CM may not be supported)

3、Strace

Strace is a Linux userspace tracer that can be used for diagnostics, debugging, and teaching. We use it to monitor user space process and kernel interactions, such as system calls, signal passing, process state changes, etc. The bottom layer of Strace uses the kernel's ptrace feature to implement its functions.

Disadvantage: Lack of useful information to analyze the problem

 

3. How to reduce the impact of disk I/O on APP performance

1. Reject main thread I/O: such as main thread DB operations, main thread file operations

2. Improve I/O efficiency: 8KB buffer read and write disk, multiplex database connection, inefficient sql statement, sql statement repeated compilation, use transaction

3. Reduce invalid I/O: repeated reading and writing, unreasonable pagesize, wrong index usage

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326690139&siteId=291194637