Chapter 18-Tuning the Operating System
Operating System Tuning
- 1、首先对内存进行调优(理论上讲,内存足够大的话,就不存在IO读写)
查看一些系统快慢的时候,首先要查看系统的内存占用率.
linux下查看内存使用情况命令vmstat(virtual memory)、vmstat 3(3秒钟变化一次)、top
- 2、对I/O进行调优
linux下查看IO使用情况命令iostat
- 3、CPU进行调优
正常情况下,CPU的利用率,应当控制在70%以下.top命令查看cpu使用情况
--------------------------------------------------------------------------
System Architectures
The Oracle database can run on different system architecturs.Some examples are:
|-Uni Processor systems
单处理器系统;单机系统;
|-Symmetric multiprocessing systems(SMP)
对称多处理器系统;多个CPU之间是对称的,共享一块内存;
|-Massively parallel processing systems(MPP)
|-Clustered systems
集群系统;常用选择;
|-Nonuiform memory architecture systems(NUMA)
--------------------------------------------------------------------------
Virtual and Physical Memory
|-Virtual memory
|-Page table possibly with ISM
|-Physical memory
--------------------------------------------------------------------------
Paging and Swaping
一个系统尽可能的避免swaping和paging
--------------------------------------------------------------------------
Tuning Memory
Database tuning can improve paging performance by locking SGA into real memory.
就是讲SGA锁定到物理内存中,有的操作系统中,不支持将SGA锁定到物理内存中,在这样的系统中设置了也白设;
SQL> show parameter LOCK_SGA; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE SQL>
建议将ORACLE的LOCK_SGA参数设置成TRUE,提升ORACLE性能.
The DBA should monitor real and virtual memory use.
The DBA should use intimate shared memory,if it is avaliable.
Tuning Memory
1、锁定SGA到物理内存
2、监控内存使用情况.根据实际情况对内存进行调整。
Tuning I/O
避免热点
热点就是说,某一个I/O Controler,频繁的读写某一个磁盘,其他磁盘读写很少;此时,可以考虑将磁盘对应的表空间进行调整,索引、表、等分配到其他的磁盘上,减少热点的发生.
小型系统,推荐使用filesystem,大系统推荐使用asm(automatic storage management)
1、Different I/O System Calls
Operating systems can perform disk I/O two different ways:
Normal(blocking) I/O
Asynchrononus(nonblocking) I/O is imleemented on most platforms and file systems.
2、有些操作系统不支持异步I/O.大部分系统都支持异步I/O;尽可能的使用异步I/O;
Tuning CPU
Guidelines:
Maximum CUP busy rate:90%
Maximum OS/User processing ratio:40/60
CPU locad balanced across CPUS
Monitoring:
CPU
Process
Orace在Unix,Linux下是多进程的,在Windows下是单进程,多线程的.
java程序是单进程,多线程的.