Linux System Tuning Basics

Source: Internet
Author: User

Linux System tuning Basics


#显示进行在哪个cpu上运行

[Email protected] ~]# PS Axo PSR,

2 NTPD

1 Qpidd

3 Pickup

3 sshd

0 Bash

2 Pscomm

#显示进行在哪个cpu上运行, and show the PID of the process

[Email protected] ~]# PS Axo psr,comm,pid

2 ntpd 3775

1 Qpidd 9998

3 Pickup 26239

2 sshd 26448

1 Bash 26450

1 PS 26496

#绑定进程号为9998的进程到第四颗CPU上

[[email protected] ~]# Taskset-p-C 3 9998

PID 9998 ' s current affinity list:0-3

PID 9998 ' s new affinity List:3


#绑定进程号为3775的进程到第一或第二颗CPU上

[[email protected] ~]# Taskset-p-C 3775

PID 3775 ' s current affinity list:0-3

PID 3775 ' s new affinity list:1,2


Note: This command is valid only for the current process and is not valid after a restart


#显示中断

[Email protected] ~]# cat/proc/interrupts



Linux System tuning Basics


[[email protected] ~]# sar-p all 1


[Email protected] ~]# iostat-c 1


[Email protected] ~]# Vmstat 1


Linux System tuning Basics


#释放缓存

[Email protected] vm]# echo 1 >/proc/sys/vm/drop_caches


[Email protected] ~]# cd/sys/block/sda/

[email protected] sda]# ls queue//2\:0\:0\:0/block/sda/

Add_random iostats minimum_io_size Rotational

Discard_granularity logical_block_size nomerges rq_affinity

Discard_max_bytes max_hw_sectors_kb Nr_requests Scheduler

Discard_zeroes_data max_sectors_kb optimal_io_size Unpriv_sgio

Hw_sector_size max_segments Physical_block_size

iosched max_segment_size read_ahead_kb

[[email protected] sda]# ls queue/iosched/

Back_seek_max Fifo_expire_sync low_latency Slice_async_rq

Back_seek_penalty Group_idle Quantum Slice_idle

Fifo_expire_async group_isolation Slice_async Slice_sync

#显示磁盘调度算法

[email protected] sda]# cat Queue/scheduler

NoOp anticipatory deadline [CFQ]

#更改磁盘调度算法

[Email protected] sda]# echo Deadline > Queue/scheduler

[email protected] sda]# cat Queue/scheduler

NoOp anticipatory [deadline] Cfq

[[email protected] sda]# ls queue/iosched/

Fifo_batch front_merges read_expire Write_expire writes_starved


[Email protected] sda]# echo CFQ > Queue/scheduler

[[email protected] sda]# ls queue/iosched/

Back_seek_max Fifo_expire_sync low_latency Slice_async_rq

Back_seek_penalty Group_idle Quantum Slice_idle

Fifo_expire_async group_isolation Slice_async Slice_sync

This article is from the "Chase Dream" blog, please be sure to keep this source http://sihua.blog.51cto.com/377227/1893019

Linux System Tuning Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.