Re: lug-bg: Elegantly wasting system resources (Was: problem)
- Subject: Re: lug-bg: Elegantly wasting system resources (Was: problem)
- From: danchev@xxxxxxxxx (George Danchev)
- Date: Sun, 16 Dec 2001 11:25:14 +0200
On Sunday 16 December 2001 10:43, you wrote:
> Vizh komandata ulimit i file-a /etc/security/limits.conf Povecheto sistemi
> po default sa taka natroeni, che shte zaspqt neprobudno pri izpylnenie na
> programa ot sorta:
>
> int main()
> {
> fork();
> main();
> }
>
> Ako si ogranichil obache maksimalniq broj procesi na user-a s podoben red
> v /etc/security/limits.conf
>
> haralampi hard nproc 64
>
> to mashinata shte ostane na kraka. Analogichno mozhesh da regulirash
> maksimalnata golemina na stack-a, pametta za proces, procesorno vreme,
> otvoreni file-ove...
>
> Petko
mda maj tova me interesuvashe. pak nesto ne sym dopro4el.
No vse pak mi se struva 4e haralampi mozhe da se izmukne i da tormozi
sistemata postoqnno v ramkite na dopystimoto....
da kazhem VM s nesto ot sorta:
---allocate.c---------
#include <stdlib.h>
main()
{
/* allocate about 20 megs, ili tam kolkoto */
/* trqbva za da se vmesti v ograni4eniqta */
void *ptr = (void *)calloc(5000000, sizeof(int));
/* naro4no ne q osvobozhdava => load (losho) */
/* namesva se OOM killer-a i pokraj tozi proces */
/* mozhe da killne i nqkoj vazhen proces */
/* kojto haralampi nqma prava da kill */
/* ste se radva da vidi: */
/* VM: killing process "us" */
/* VM: killing process bash */
/* VM: killing process apache */
/* and so on ... *grinz* */
/* free(ptr); */
}
-------------------------
led koeto q startira gurbo, kernel-a ste se bori s zubi i nokti za da zapazi
machinata *up*. Spravq se, no tyrpi tormoz, da kezhem v ramkite na
dopystimoto.... a tova mozhe da se slu4va permanentno. damn.
----avalanche.sh----------
#!/bin/bash
z=0;
while [ $z != 1 ] ; do
./allocate &
done
-------------------------------
ili po-kulturno, ve4e kontroliruemo. Ako trea ste opredeli MemFree+SwapFree i
ste se opita da shruska kolkoto mozhe ot tqh.
------avalanche2.sh----------------------
# naprimer: 3/4 of RAM+SWAP sa Free, startirajki
# allocate (zaemasta po 20 megs/time) N pyti
# N = 3/4 * (RAM+SWAP)/20 ve4e ne sa free.
z=0;
while [ $z != 1 ] ; do
# running "allocate" N times.
for i in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
./allocate &
done
done
---------------------------
Sled tova ste se seti da pridizvika severe disk I/O activity ... i t.n.
Ste my setna quotas, i gornite ograni4eniq, ama vinagi mozhe da si dovle4e
source ili binaries v home dir-a i da si pravi experimenti.
10x, kakto i da e ... ste pomislq za limits.conf.
--
Greets,
fr33zb1
===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|