Ana içeriğe atla

Kayıtlar

Temmuz, 2021 tarihine ait yayınlar gösteriliyor

ssh servisinin ram tükensede çalışmasını istemek ( oom killer ve ssh ) ve ssh ile sisteme bağlanan kişilerin sistem kaynağını tüketmesini önlemek

Oncelikler asagidaki baglantidan linux hafiza yonetimine bakmak faydali olur. https://linux-mm.org/OOM_Killer It is the job of the linux 'oom killer' to sacrifice one or more processes in order to free up memory for the system when all else fails. It will also kill any process sharing the same mm_struct as the selected process, for obvious reasons. Any particular process leader may be immunized against the oom killer if the value of its /proc/<pid>/oomadj is set to the constant OOM_DISABLE (currently defined as -17).  Genelde ram  tükendiğinde oom killer çalışan normal işlemleri öldürmeye başlar. sshd islemlerinin oom_adj parametresini  kontrol ettigimizde,  pgrep sshd  | while read PID; do echo $PID;cat /proc/$PID/oom_adj;done 1244 -17 6425 0 sshd dinleme modunda calismaya basladiginda oom_adj -17 olarak  goruyoruz. oom_adj=17 bu islemin kesinlikle oldurulmemesi demektir. Fakat bizim ssh ile baglandigimizda olusan alt islemin  oom_adj degeri 0 goruyoruz. Yani sistemde se