Qeb khoom
Tiv tauj peb
Ntxiv: 5F, Tsev 3A, No.8 Xiyuanyi Road, West Lake Science Park, Hangzhou, Suav
Tel: + 86-571-87858811
Mob: +8613616520351
E-mail: trade@qiyangtech.com
Xov xwm
Tsev > Xov xwm > Ntsiab lus
Yuav ua li cas tso Linux Nco kev Manually? Siv I.mx6 Ua Tus Piv Txwv
Jul 27, 2018

Ua ntej, qhov xwm txheej niaj zaus

Thawj tham "dawb" hais kom ua:

Quotes:

[root @ server ~] # dawb -m tag nrho siv dawb sib koom ua ke cached Mem: 249 163 86 0 10 94 - / + buffers / cache: 58 191 Swap: 511 0 511

ntawm lawv:

Quotes:

tag nrho lub cim xeeb tag nrho, naj npawb ntawm nco twb siv, dawb xov tooj ntawm dawb nco, tag nrho tus nqi ntawm kev sib nco ntawm ntau cov txheej txheem, qhov loj ntawm disk ntawm buffers Cache thiab cached phab ntsa nco ntsoov-cache nco: Cov xov tooj ntawm kev nco - buffers - cached + buffers / cache dawb + buffers + cached muaj nco = dawb nco + buffers + cached.

Nrog lub hauv paus no, koj paub tau tias kuv tam sim no siv rau 163MB, pub dawb rau 86MB, tsis thiab cached muaj 10MB, 94MB.

Tom qab ntawd cia saib yog tias muaj kev hloov hauv kev nco yog tias kuv ua cov ntaub ntawv luam.

Quotes:

[cag @ server ~] # cp -r / etc ~ / test / [root @ server ~] # dawb -m tag nrho siv dawb sib koom buffers cached Mem: 249 244 4 0 8 174 - / + buffers / cache: 62 187 Swap : 511 0 511

Tom qab kuv tau ua raws li qhov kawg, siv rau 244MB, pub dawb rau 4MB, buffers rau 8MB, cached rau 174MB. Vaj tswv, tag nrho cov tau noj los ntawm cached. Tsis txhob ntshai, qhov no yog los txhim kho cov ntaub ntawv ntawm kev nyeem ntawv xyaum.

Yuav kom txhim kho efficiency, Linux tau ua tiav ib co qauv tsim, ntxiv rau lub dentry cache (rau VFS, kom tuaj conversion ntawm qhov ua ntaub ntawv lub npe mus rau inode), kuj tau siv ob txoj kev Cache: Tsis

Cache thiab nplooj ntawv Cache. Lub qub yog rau disk nris nyeem thiab sau ntawv, tom kawg yog rau cov ntaub ntawv inode nyeem thiab sau ntawv. Cov Cache no muaj zog ua haujlwm zoo

I / O system hu lub sij hawm (xws li nyeem ntawv, sau ntawv, tau txais).

Tom qab ntawd ib tug neeg tau hais tom qab lub sijhawm, linux yuav cia li tso lub cim xeeb siv. Tos rau qee lub sij hawm, peb siv dawb los sim dua los saib yog tias tso tawm?

Quotes

[hauv root @ server test] # dawb -m tag nrho siv dawb sib koom siv cached Mem: 249 244 5 0 8 174 - / + buffers / cache: 61 188 Swap: 511 0 511

Muaj zoo li tsis muaj kev hloov. (nyob rau hauv lub qhov teeb meem tiag tiag, lub cim xeeb kev tswj yog tseem ceeb mus sib puav)

Li ntawd, kuv tau manually tso lub cim xeeb? Cov lus teb yog muaj!

Secondly, manually tso lub cache

/ proc yog ib qhov system ua cov ntaub ntawv, peb tuaj yeem nyeem thiab sau tau los ntawm nws txhais tau tias kev sib txuas lus nrog kernel tus neeg. Ua lwm yam lus, koj tuaj yeem hloov cov ntaub ntawv / proc xa ntawv kom hloov mus rau tam sim no tus cwj pwm. Tom qab ntawd peb tuaj yeem kho lub / proc / sys / vm / drop_caches kom tsis txhob nco. Lub lag luam yog raws li hauv qab no:

Kev siv [root @ server test] # cat / proc / sys / vm / drop_caches 0 Ua ntej, tus nqi ntawm / proc / sys / vm / drop_caches sai rau 0. Nqe lus [root @ server test] # sync

Manually ua tus commandc command (piav qhia: sync hais kom khiav lub sync subroutine.Yog hais tias koj yuav tsum tau nres lub cev, khiav cov lus sib sim sync kom cov ntaub ntawv system integrity .sync

Hais kom sau tag nrho cov ntawv sau tsis tau mus rau disk, nrog rau kev hloov kho-iav, qeeb thaiv I / O, thiab nyeem ntawv-sau ntawv cov ntaub ntawv)

Tsab ntawv tso tawm [root @ server server] # echo 3> / proc / sys / vm / drop_caches [root @ server test] # cat / proc / sys / vm / drop_caches 3 teeb / proc / sys / vm / drop_caches rau 3 cim @server test] # dawb -m tag nrho siv dawb sib koom ua ke cached Mem: 249 66 182 0 0 11 - / + buffers / cache: 55 194 Swap: 511 0 511

Ces khiav cov lus txib dawb, koj yuav pom qhov tam sim no siv rau 66MB, pub dawb rau 182MB, buffers rau 0MB, cached mus 11MB. Yog li nws yog qhov zoo tshaj tawm ntawm lub ntas thiab cache.

Siv cov / proc / sys / vm / drop_caches hauv qab no

Quote / proc / / sys / vm / drop_caches (txij li Linux 2.6.16) Sau ntawv rau hauv cov ntaub ntawv no ua rau lub ntsiav pov tseg huv caches, cov dej caws qia thiab cov nta ntawm qhov cim xeeb, ua qhov cim xeeb los ua dawb. Yog xav tau dawb pagecache, siv lo lus nug 1> / proc / sys / vm / drop_caches; mus rau dentries dawb thiab inodes, siv echo 2> / proc / sys / vm / drop_caches; mus pub dawb pagecache, hauv cheeb tsam thiab inodes, siv ncha 3> / proc / sys / vm / drop_caches. Vim tias qhov no yog qhov tsis ua haujlwm thiab cov khoom qias neeg tsis muaj kev ywj pheej, tus neeg siv yuav tsum khiav los ua sync ua ntej.

Thirdly, kuv xav

Tsab xov xwm saum toj no tau muab ntau lo lus teb "intuitive" rau Linux kev tswj xyuas cov lus nug los ntawm ntau cov neeg siv tau ntau xyoo, Kuv xav tias me ntsis zoo li cov tub ntxhais txoj kev loj hlob pab pawg.

Kuv muaj kev tshwj xeeb txog seb kuv puas yuav tsum tau siv qhov txiaj ntsig no los yog hais txog tus nqi rau tus neeg siv:

Quotes

1, nws pom tau los ntawm tus txiv neej, qhov nqi no yog muab tom qab 2.6.16 core version, yog li ntawd, tus qub version ntawm lub operating system, xws li liab chij DC 5.0, cov ntaub ntawv ua ntej RHEL 4.x tsis muaj qhov no ;

2, yog lub cim xeeb yog txaus rau qhov kev soj ntsuam, kuv tseem npaj siab yuav pom qhov kev siv ntawm sib puav thiab qhov loj ntawm ob qhov tseem ceeb ua / yog li ntawd;

Cov lus nug feem ntau yog, yog vim li cas tsis tshua muaj me me, seb puas nco tsis tau tom qab kaw daim ntawv thov?

Tab sis qhov tseeb, peb txhua tus paub tias qhov no yog vim Linux txawv ntawm qhov rais ntawm kev tswj hwm kev tswj hwm, dawb me me tsis yog tias lub cim xeeb tsis txaus, koj yuav tsum pom tus nqi kawg ntawm tus kab thib ob ntawm cov dawb:

Quotes

- / + buffers / cache: 58 191

Qhov no yog qhov cim ntawm lub cim xeeb muaj rau lub system.

Daim phiaj xwm no qhia rau peb tias yog tias daim ntawv thov muaj teeb meem xws li lub cim xeeb xau, teeb meem txeej, nws tuaj yeem ceev nrooj txiav txim los ntawm kev siv qhov pauv, tab sis cov saum toj no yog qhov nyuaj dua.

Ntawm qhov tsis yog, lub sij hawm no, yog tias peb qhia tus neeg siv los kho qhov system muaj nqis, "tau" tso lub cim xeeb, dawb yuav loj dua. Dab tsi yuav tus neeg siv xav? Lawv tsis xav tias txoj haujlwm operating "muaj teeb meem"?

Yog li ntawd, vim hais tias cov tub ntxhais yuav tuaj yeem ceev cov tsis tuaj los yog cache, nws tsis yooj yim ua (uas tuaj yeem pom los ntawm cov haujlwm saum toj no), tiam sis qhov tseem ceeb tsis ua (qhov no yog 0), peb yuav tsum tsis txhob hloov nws casually.

Raws li ib txwm muaj, daim ntawv thov kev lag luam yog ua haujlwm ruaj khov rau hauv lub cev, thiab tus nqi dawb yuav nyob ntawm tus nqi ruaj khov, tab sis nws yuav zoo dua qub.

Thaum muaj kev nco tsis txaus, daim ntawv thov tsis tuaj yeem muaj kev nco, OOM yuam kev thiab lwm yam teeb meem, peb yuav xav paub ntau ntxiv ntawm daim ntawv thov, xws li cov nqi ntawm cov neeg siv loj heev uas ua rau nco tsis txaus, daim ntawv thov nco pauv, txwv tsis pub, tshem qhov tsis tuaj yeem yuam kev los mus dawb li qhov dawb, yog li ntawd, nws yuav cia li muab qhov teeb meem rau lub shield ib ntus.

Yog li, kuv xav tias, tsis suav cov tsis nco, tshwj tsis yog nws yog nyob rau hauv software tsim theem, peb yuav tsum tau mus ib ntus ntshiab lub ntiag tug los txiav txim rau daim ntawv thov ntawm nco pab; los yog daim ntawv thov tsis muab kev pab ntxiv, txawm tias daim ntawv thov muaj teeb meem rau lub cim xeeb, thiab Tsis muaj peev xwm zam qhov teeb meem, peb tsuas xav txog lub sij hawm tawm ntawm lub ntiag tug. (Hmoov tsis, xws li daim ntawv sau npe feem ntau khiav ntawm lub qub operating system version, cov haujlwm saum toj no tsis tuaj yeem kho tau).


QY-IMX6-V.jpg

  • Newsletter
  • Qeb khoom
  • Tiv tauj peb
    Ntxiv: 5F, Tsev 3A, No.8 Xiyuanyi Road, West Lake Science Park, Hangzhou, Suav
    Tel: + 86-571-87858811
    Mob: +8613616520351
    E-mail: trade@qiyangtech.com
  • QR Code
  • Copyright © Zhejiang Qiyang Intelligent Technology Co., Ltd Qoob loo.