Swappiness: Uhlengahlengisa njani ukusetyenziswa kwememori ebonakalayo

 

swappiness imemori ebonakalayo

Apha e-Ubunlog sizinikele- okanye sizama- kubo bonke abasebenzisi, kwaye oko kubandakanya ulungelelwaniso lwezixhobo ezahlukeneyo. Kwaye ngandlela thile siyathanda ukucinga ukuba ngezifundo esizibonisayo apha sinegalelo ngandlela thile ukuphucula amava ngokubanzi okusetyenziswa kule distro siyithandayo kakhulu (nakwezinye iincasa zayo), ngenxa yeso sizathu amaxesha amaninzi sipapasha izikhokelo ye ufumane ukusebenza kakuhle kunokwenzeka, ngakumbi kwizixhobo ezithobeke ngakumbi.

Ngoku, ngaphandle kokuya phambili, siza kubonisa uhlengahlengisa njani ukusetyenziswa kwememori ebonakalayo kwi Ubuntu, ngendlela eya kuthintela ukuba ekugqibeleni iphele iba kukutsala kunye nokwenza intsebenzo ibe mbi kunokuba ibiya kuba ngaphandle kwayo. Kwaye nangona umbono wokusebenzisa ifayile okanye ukwahlula-hlula awulunganga ngokwawo kodwa ngokuchaseneyo, ukuba awuphunyezwanga kakuhle unokuvelisa ukusetyenziswa gwenxa kwehard disk, kancinci kancinci kune Imemori ye-RAM.

Ngesi sizathu, ukusetyenziswa kwesahlulelo sokutshintsha kufuneka kuthintelwe kwiimeko apho kungekho enye indlela ngaphandle kokuyisebenzisa, ngelo xesha iya kuthi ixhase inkumbulo ephambili (eyi-RAM). Ukuba endaweni yoko siyisebenzisa ngawo onke amaxesha, ngamanye amaxesha nangaphambi kwe-RAM, ukusebenza kwethu kuya kohlwaywa. Masibone ngoko indlela yokuhlengahlengisa ukusetyenziswa kwememori ebonakalayo kwiLinux usebenzisa umyalelo weSwappiness.

Kwinkqubo yethu yokusebenza, ukwenziwa kwememori ebonakalayo ihlala isenziwa ngexesha lenkqubo yofakelo, ngelo xesha sichaza isahlulelo seengcambu (/), isahlulelo sokugcina (/ ikhaya) kunye nesahlulelo sokutshintshiselana okanye Ukutshintsha, okuhlala kusenziwa kwisahlulelo / i-dev / sda5. Ipharamitha ye-kernel elawula ukusetyenziswa kwememori ebonakalayo kukungxama okukhankanywe ngaphambili, kwaye ngokusisiseko singatsho ukuba kulawula ukuchaza ukuba silifumana kangaphi ukwahlulahlula kunye nokuba ungakanani umxholo esiwukopiselayo kuwo, ngengxoxo eyahluka phakathi 0 kunye ne-100.

Ixabiso elingagqibekanga kufakelo lweLinux ngama-60, kodwa njengoko kulula ukuyicinga, ayizizo zonke iinkqubo zehardware ezifanayo kwaye ke ayenzi ngqondo ukugcina elo nqanaba nokuba leliphi na elethu. Eli xabiso ligcinwa kwi / proc / sys / vm / swappiness file, kwaye singayijonga ngo:

ikati / pro / sys / vm / swappiness

Ngokuqinisekileyo iya kuba kwi-60, kwaye ukuba kunjalo kunjalo sinokuyiguqula, ngakumbi Ukuba sinememori engaphezulu kwe-4 GB yememori ye-RAM, kuba kwimeko leyo sidla ngokufuna imemori encinci okanye singabi nayo. Kodwa ngaphambi kokuchaza ukuba ungayiguqula njani loo nto, makhe sijonge kancinci malunga nengcinga engemva kwayo yonke le nto malunga nememori ebonakalayo kunye nokuqina; Kwaye kukuba xa ishiywe ngokungagqibekanga kuma-60, into exelelwa i-kernel kukuhamba kwaye isebenzise imemori ebonakalayo xa inkumbulo yethu ye-RAM ineepesenti ezingama-40 okanye ngaphantsi komthamo wayo wasimahla. Ke, ukuba siseta swappiness elingana ne-100 imemori ebonakalayo iya kusetyenziswa ngalo lonke ixesha, kwaye ukuba siyishiya ngexabiso eliphantsi kakhulu, iya kusetyenziswa kuphela xa i-RAM yethu sele iza kuphela. Ubuncinci obunokwenzeka yi-1, ukushiya ixabiso elilingana no-0 siyicima ngokupheleleyo inkumbulo ebonakalayo.

Ke into ekufuneka siyenzile kukufaka lo myalelo ulandelayo kwi-terminal (Ctrl + Alt + T):

Isudo sysctl vm. ulonwabo = 10

Ngoku ixabiso le Ukuthuthuka kuya kuba li-10, kwaye imemori ebonakalayo ayinakusetyenziswa. Xa eli xabiso litshintshiwe akukho sidingo sokuqalisa ikhompyuter kodwa iqala ukusebenza kwangoko, kwaye enyanisweni ukuba siseta kwakhona ixabiso liya kubekwa kuma-60 njengangaphambili, kuba into esiza kuyidinga kukushiya olu tshintsho lusekwe ngokusisigxina. Ukwenza oku, nje ukuba sisebenzise ikhompyuter yethu kwaye siqinisekisile ukuba yonke into ilungile ngexabiso elitsha le-swappiness, senza:

Isudo nano /etc/sysctl.conf

emva koko sijonga isicatshulwa vm.swappiness = kwaye songeza ixabiso elifunekayo emva kophawu "=". Sigcina ifayile kwaye ngoku ewe, utshintsho luya kuhlala ngokusisigxina.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Izimvo ezi-15, shiya ezakho

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   cesflo sitsho

    Ingcaciso entle kakhulu !!! Inqaku elilunge kakhulu !! Kwimeko yam xa ndenza olu tshintsho xa ndiqala kwakhona incwadi yokubhalela ibuyela kwixabiso lantlandlolo lama-60, kufana nokuba ifayile igcinwe kodwa xa uyiqala kwakhona «ifomathiwe». Sele ndizamile yonke into ngaphandle kwempumelelo, ngaba unalo uluvo lokuba kwenzeka ntoni? Ndine-1GB yeRam.

    Gracias !!

    1.    UWilly klew sitsho

      Molo uCesar, ndonwabile ukuba uyifumene inomdla.

      Ukuba ixabiso lilahlekile xa inkqubo iqalisa kwakhona ndiza kujonga /etc/rc.local kunye nezinye izikripthi zokuqalisa (ziyahluka ngokwe-distro nganye) njengoko oku kungasetwa ekuqaleni.

      Nibuliso!

  2.   U-Pascual Martin sitsho

    Ingcaciso entle kakhulu!

    Njengomphelelisi, nantsi enye into enomdla malunga nokutshintsha kunye nokuthuthuka kwiLinux:

    http://www.sysadmit.com/2016/10/linux-swap-y-swappiness.html

  3.   imeko yombukeli sitsho

    awuyazi ukuba ilunge kangakanani le nto kum, enkosi

  4.   abefundisi sitsho

    Regards,

    Kwam /etc/sysctl.conf ayisosicatshulwa vm.swappiness =, Ndayikhangela kakuhle, ifayile incinci. Ngaphandle kokuba uyongeze, inqaku lithi ukufumana kunye nokuguqula ixabiso, hayi ukongeza umgca.

  5.   Lewis sitsho

    Regards,

    Kwam /etc/sysctl.conf akukho vm.swappiness = text. Ngaphandle kokuba uyongeze, inqaku lithi ukufumana kunye nokuguqula ixabiso, hayi ukongeza umgca.

  6.   Nosferatus sitsho

    Kuya kufuneka uyile, ekugqibeleni kwifayile oyibekayo vm.swappiness = 10 yiyo ke leyo.

    Ukuba ayigcini ekuqaliseni kwakhona kungenxa yokuba awusebenzisi umyalelo weSudo.

    Ubuntu: Isudo gedit /etc/sysctl.conf
    Xubuntu: Sudo mousepad /etc/sysctl.conf

  7.   santiago sitsho

    Inqaku elihle. Enkosi!

  8.   URoberto sitsho

    Ungabeka u-zero. Zeziphi iingxaki ezinokuvela?

  9.   UJose Castillo Ávalos sitsho

    Molo kwaye ndiyabulela uWilly Clew ngenqaku lakho elicacisa gca kum inkqubo yokusebenzisa imemori ye-swapp, kodwa indenze ndathandabuza kakhulu kuba xa ungena kwisiphelo sendlela kwaye usenza imiyalelo oyibonisayo, ubuyisela umyalezo othi:

    bash: cat / proc / sys / vm / swappiness: Ifayile okanye ulawulo alukho

    Yintoni enokubangelwa koku?

    1.    UAndrés Choque Lopez sitsho

      Ubhale kakubi. Khange ubeke sithuba emva "kwekati."

  10.   ukwenza umkhenkce sitsho

    kakhulu, sabelana ngayo kwiqela lobuntu ngeSpanish https://t.me/ubuntu_es

  11.   Smith sitsho

    Ukugqwesa kundisebenzele kwi-Debian 10.9

  12.   juan sitsho

    Ndisisazinzulu sekhompyuter endisifakileyo kwaye ndazivavanya ii-distros ezininzi, olona khetho lufanelekileyo lokumisela ukuthoba kukubhala kwisiphelo sendlela

    Isudo nano /etc/sysctl.conf

    emva kokucinezela ukungena bhala isitshixo kwaye ungene kwakhona, emva koko bhala ekugqibeleni lo mgca ulandelayo

    vm. ulonwabo = 0

    cinezela ctrl kunye no-x ngexesha elinye, uvelisa umbuzo ukuba ufuna ukugcina isivakalisi esitsha kwifayile cofa iqhosha le-Y ukuze uthi ewe naku-n ukuze ingagcini.

    Kutheni ndibhale u-0? Uvavanyo sele lwenziwe kwii-PC ezahlukeneyo endizicwangcisileyo kuba lolona khetho lulungileyo kuba lusebenzisa ubuhedeni kodwa umzekelo ukuba i-chromium okanye isikhangeli sivulwa ngokuvula i-Facebook kuba inkumbulo yotshintshiselwano (itshintshe okanye ikwabize ubuhedeni) iya kwanda kodwa xa kuvaliwe iseshini kunye nesikhangeli okanye nayiphi na inkqubo kuba inkumbulo ye-paging (swap) iya kunciphisa ukukhulula idiski eluncedo ukuyiphepha ukuyonakalisa, khumbula ukuba imemori yokutshintsha okanye ebizwa ngokuba yi-paging (swap) isebenzisa idiski enzima.

  13.   UNorberto gonzalez sitsho

    Andiqondanga, uxolo. Ukuba okungagqibekanga ngama-60 kutshintshwe kwenziwe kusebenze nge-40 okanye ngaphantsi kokulahleka, xa useta ipharamitha ukuya kwi-10. Ngokucothisa ukutshintshiselana ngedatha