## 3.4.1  Analyzing I/O Throughput and Latency
When analyzing I/O, the focus is on throughput and latency (time taken). A set of system views (with names beginning m_VOLUME_IO_*) is available to help you analyze throughput and examples are given here to illustrate how they can be used.
You can use the following example query to read I/O statistics data which will help you to analyze the throughput of the system (in this example the index server). The result of this query presents a set of columns including throughput in MB and trigger ratios (the relationship between trigger time and I/O time) for both read and write operations:
```
select v.host, v.port, v.service_name, s.type, round(s.total_read_size / 1024 / 1024, 3) as "Reads in MB", round(s.total_read_size / case s.total_read_time when 0 then -1 else s.total_read_time end, 3) as "Read Throughput in MB", round(s.total_read_time / 1000 / 1000, 3) as "Read Time in Sec", trigger_read_ratio as "Read Ratio", round(s.total_write_size / 1024 / 1024, 3) as "Writes in MB", round(s.total_write_size / case s.total_write_time when 0 then -1 else s.total_write_time end, 3) as "Write Throughput in MB", round(s.total_write_time / 1000 / 1000, 3) as "Write Time in Sec"   , trigger_write_ratio as "Write Ratio" from "PUBLIC"."M_VOLUME_IO_TOTAL_STATISTICS_RESET" s, PUBLIC.M_VOLUMES v where s.volume_id = v.volume_id and type not in ( 'TRACE' ) and v.volume_id in (select volume_id from m_volumes where service_name = 'indexserver') order by type, service_name, s.volume_id;
```
Note that some of the system views for I/O can be used with a resettable counter so that you can gather data for just the most recent period since the counter was set. This example is based on the m_VOLUME_IO_TOTAL_STATISTICS system view but uses the 'reset' version of the view.
You can reset the statistics counter to analyze the I/O throughput for a certain time frame by running the following reset command:
alter system reset monitoring view m_VOLUME_IO_TOTAL_STATISTICS_RESET;
## Multitier and Replication Scenarios
In a system using replication between primary and secondary sites it is possible to analyze throughput of the secondary remotely by running these queries on the primary site. This method uses the proxy schema of the secondary system on the primary and can be used in a 2-tier system replication setup as well as for multitier landscapes.
The proxy schema follows the naming convention _SYS_SR_SITE_&lt;siteName>=, where &lt;siteName>= is the name of the secondary site (case-sensitive). In the FROM clause of the example query given above the schema PUBLIC is used; in a system replication landscape replace this with the proxy schema, for example: _SYS_SR_SITE_SiteB':
```
from "_SYS_SR_SITE_SiteB"."M_VOLUME_IO_TOTAL_STATISTICS_RESET" s, "_SYS_SR_SITE_SiteB"."M_VOLUMES" v
```
Note that this specific example will only work in an Active/Active (Read Only) scenario because the view m_VOLUMES is only available in the proxy view in operation mode logreplay_readaccess, not in other operation modes.
## Trigger Ratios
I/O calls are executed asynchronously, that is, the thread does not wait for the order to return. The trigger-ratio of asynchronous reads and writes measures the trigger time divided by the I/O time. A ratio close to 0 shows good performance; it indicates that the thread does not wait at all. A ratio close to 1 means that the thread waits until the I/O request is completed.
Refer to SAP Note 1930979 and SAP Notes for Alerts 60 and 61 for more information about the significance of the trigger ratio values.
## Latency
The latency values are important for LOG devices. To analyze the latency, use the following example query which returns the log write wait time (for data of type LOG) with various buffer sizes written by the index server. The time values returned are the number of microseconds between enqueueing and finishing a request.
```
select host, port type, round(max_io_buffer_size / 1024, 3) "Maximum buffer size in KB", trigger_async_write_count, avg_trigger_async_write_time as "Avg Trigger Async Write Time in Microsecond", max_trigger_async_write_time as "Max Trigger Async Write Time in Microsecond", write_count, avg_write_time as "Avg Write Time in Microsecond", max_write_time as "Max Write Time in Microsecond" from "PUBLIC"."M_VOLUME_IO_DETAILED_STATISTICS_RESET" where type = 'LOG' and volume_id in (select volume_id from m_volumes where service_name = 'indexserver') and (write_count <> 0 or avg_trigger_async_write_time <> 0);
```
## Related Information
SAP Note 1930979 m_VOLUME_IO_TOTAL_STATISTICS_RESET System View Alerts Reference [page 302]