VM: killing process X

Theodoros V. Kalamatianos thkala at softlab.ece.ntua.gr
Sat May 29 11:10:11 EEST 2004



On Sat, 29 May 2004, Konstantinos Peletidis wrote:

> Dystyxws den einai eukolo na vrw peiramatika poios mhxanismos einai
> kalyteros. Gia thn istoria, xrhsimopoiwntas kernels mexri kai ton
> 2.4.25(pou epishs den exei OOM by default AFAIK) den eixa tetoio
> provlhma. Gi'auto allwste den ekfrazw kapoia idiaiterh protimhsh. O
> 2.4.26 mou ekane thn ekplhksh :-(

Proswpika auto to synanthsa kai me kapoious apo tous prwtous OOMK-less 
kernels. Twra teleutaia den to exw dei... alla apo thn allh otan dw thn 
swap na douleuei san trelh rixnw mia matia kai skotwnw tous amartountes me 
to xeri prin analavei drash o kernel.

> Den kserw pws to vlepeis esy, h oi alloi xrhstes, alla egw pistevw pws
> an exeis ena systhma pou trexei X kai einai idle, kai molis o crond(no X
> activity) treksei ena script pou kanei update mia database, o kernel
> skotwnei ton X, tote ta pragmata einai sovara. Isws na hmoun tyxeros ws
> twra epeidh den mou synevh nwritera kati tetoio. Mporei na einai
> synh8ismenoo to fainomeno kai ola auta isws na einai ypervoles ek
> merous mou. Opoiadhpote plhroforia sxetika me th syxnothta emfanishs
> tetoiou eidous provlhmatwn 8a me boh8ouse na ektimhsw kalytera thn
> katastash.

Pantws, an thymamai kala, auto to dilhma arxika htan ena akoma dilhma 
desktop vs. server orientation. Skepsou to ekshs senario:

- Exeis ena server me 4GB (RAM+swap) kai afthono CPU power. Auto trexei 
p.x. mia Oracle database pou ypo fysiologikes synthikes trwei 3.5 GB.

- Kapoio allo process, p.x. ena slocate (anaferw to sygkekrimeno, giati 
diapistwsa pws to slocate an tou valeis megalo arithmo orismatwn trwei 
mnhmh san diaolos... den kserw to aplo locate ti kanei...) trwei to 
ypoloipo miso GB kai fernei to systhma se katastash OOM.

- if (kernel_has_OOM_killer)
 	/* Nai, nai ... kala katalaves... thn plhrwnei h... */
 	kill(auton_me_thn_pollh_mnhmh); /* ...polytimh sou DB */
   else
 	kill(osous_zhtoun_RAM_mexri_na_vgeis_apo_to_OOM);

H ousia einai oti yphrxan periptwseis pou akoma kai otan o kernel 
prospathouse na fanei eksypnos me ton OOM killer ekane tragika lathi... 
Twra mporei se ena desktop o ypaitios na einai o mozilla (i.e. autos pou 
eixe hdh pollh mnhmh kai zhtouse kai allh), alla se servers syxna thn 
plhrwne autos akrivws pou DEN htheles na thn plhrwsei. Opote apofasisan 
oti mexri na vrethei kalyterh lysh (p.x. kati san process 
whitelists/blacklists) na afhsoun ton kernel na kanei to pio aplo pragma 
pou ginetai kai na skotwsei auton pou zhta th mnhmh (pou synithws einai 
kai o ypaitios tou OOM - ase pou mallon tha pethaine apo elleipsh mnhmhs, 
aneksarthta apo thn apofash tou kernel), anti na myrizei ta nyxia tou 
prospathwntas na vrei ti na skotwsei.

Proswpika den exw idiaiterh protimhsh anamesa sta dyo... alla apo thn allh 
h swap mou kanei konta 1min na gemisei, opote exw to xrono na antidrasw an 
kati paei agriws strava. Pisteuw omws oti prwtarxikos stoxos tou kernel se 
OOM prepei na einai na vgei apo to adieksodo, wste to systhma na mporei na 
synexisei na leitourgei, estw kai an auto shmainei na skotwsei ta panta 
ektos tou init. To an tha dysaresthsei ton user/admin me tis dolofonikes 
epiloges tou einai nomizw deutero... o idios user/admin mallon tha htan 
poly pio dysaresthmenos an to systhma apla kollage.

BTW, yphrxe oloklhro thread sxetika me thn afairesh tou OOM-killer sto 
www.kerneltrap.org, tha vreite arketa endiaferouses apopseis ekei.


Auta gia twra,
Theodoros Kalamatianos




More information about the Linux-greek-users mailing list