[ LUGOS ] nice-renice na apache servisu

Borut Mrak borut.mrak na ijs.si
Tor Jan 9 23:03:22 CET 2001


On Tue, Jan 09, 2001 at 02:25:38PM +0100, Rok Krulec wrote:
> Rad bi, da bi moj Apache pojedel samo 90% vseh resourceov racunalnika oz.
> se hujse, ko je racunalnik na 91%, se zacne apache tako dolgo pobijat, da
> pride sistem spet na 90%.

Lahko napises modul, ki bo ob vsakem requestu preveril, ce je racunalnik
preobremenjen in temu primerno reagiral (recimo tako da pocaka 5 sekund
ali pa vrne page SERVER OVERLOAD!!! GO AWAY!!!)

Mislim pa, da je boljse masino malo bolje nastavit ali pac, ce ne gre
drugace, resit problem s financno injekcijo.

> Ali je to doable z nice-renice in predvsem ali je ze kdo to naredil. Ali
> ima kdo kaksen drugacen predlog, kako narediti, da masina ne umre od
> overloada na dolocenem servisu.

Ah no...saj kaksno stvar se pa le da nastavit...

Ce recimo ves, da je troublemaker apache, potem napises skriptico, ki
preveri load, in ce je le-ta vecji od dolocene meje, zamenja httpd.conf
s takim, ki vraca samo blank page in naredi apachectl reload.

Ni pa to uporabno pri resnem delu...tam se resis tako, da problem
zdravis financno...z boljso masino.

> Kje v kernelu se ze poveca stevilo file-descriptorjev ki so lahko odprti ?

Documentation/proc.txt:

file-nr and file-max
   The kernel allocates file handles dynamically, but as yet
   doesn't free them again.

   The value in file-max denotes the maximum number of file handles
   that the Linux kernel will allocate. When you get a lot of error
   messages about running out of file handles, you might want to raise
   this limit. The default value is 4096. To change it, just write the
   new number into the file:

   # cat /proc/sys/fs/file-max
   4096
   # echo 8192 > /proc/sys/fs/file-max
   # cat /proc/sys/fs/file-max
   8192
[...]
   The three values in file-nr denote the number of allocated file
   handles, the number of used file handles, and the maximum number of
   file handles. When the allocated file handles come close to the
   maximum, but the number of actually used ones is far behind, you've
   encountered a peak in your usage of file handles and you don't need
   to increase the maximum.

   However, there is still a per process limit of open files, which
   unfortunatly can't be changed that easily. It is set to 1024 by
   default. To change this you have to edit the files limits.h and
   fs.h in the directory /usr/src/linux/include/linux. Change the
   definition of NR_OPEN and recompile the kernel.

lp,

-- 
Borut
borut.mrak na ijs.si
-----------------
"Stupidity is platform independent." (c) Josef




Dodatne informacije o seznamu Starilist