Re: lug-bg: Elegantly wasting system resources (Was: problem)
- Subject: Re: lug-bg: Elegantly wasting system resources (Was: problem)
- From: ochinko@xxxxxxxxxxxx (Petko Boukov)
- Date: Sun, 16 Dec 2001 16:43:23 +0800
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
-----Original Message-----
From: George Danchev <danchev@xxxxxxxxx>
Date: Sat, 15 Dec 2001 14:54:23 +0200
To: lug-bg@xxxxxxxxxxxxxxxxxx
Subject: Re: lug-bg: Elegantly wasting system resources (Was: problem)
> On Friday 14 December 2001 21:59, you wrote:
> > Ops gaden problem, pokazva li nqkakvi dumpove na dipleq ili v syslog-a?
> > Ili prosto se rebootva? Q probvai da si napravish nqkoq programa deto
> > tovari procesora i vig kak se dargi, primerno da smqta chisla s mnogo znaci
> > sled dec zapetaq.
> Taka, bratq... zna4i az reshih malko da si poigraq s resourses na systemata.
> Da kazhem imame user "haralampi" na edi koq si sistema (nqma root prava).
> Ssh-va se remote ili ima fizi4eski dostyp i se log-va local-no s
> prostosmyrtniq username "haralampi" ... tova ne e ot golqmo zna4enie...
>
> kompilira si, volno ili nevolno, slednata _brainless_ anti programka:
> (znam 4e e lame, no "haralampi" i haber si nqma ot C ;-)
>
> -----test.c--------------
> main()
> {
> float x,y,z;
> x=20.5123456789034567;
> y=30.3343255346567767;
> z=40.2245454345654655;
> while (y<50)
> {
> if (x<1000)
> {
> x=x*y*x*y;
> z=x*y+x/y+y/x+x+y;
> printf("x1=%50.30f\n", x);
> printf("z1=%50.30f\n", z);
> }
> else
> {
> x=x/y+y/x;
> z=x*y-x/y-y/x+x+y;
> printf("x2=%50.30f\n", x);
> printf("z2=%50.30f\n", z);
> }
> }
> }
> -------------------------------------
>
>
> Sled tova pak bez da iska haralampi q startiram taka:
> ---------avalanche.sh------
> #!/bin/bash
> z=0;
> while [ $z != 1 ] ; do
> ./test &
> done
> ----------------------------
>
> Okazva se 4e se polu4avat razli4ni rezultati v zavisimost ot tova dali e
> startiran ./avalanche.sh v xterm/konsole/gnome-terminal ili v TTY.
> (sled izvestno vreme izliza i slednoto syobstenie pri opit da se podade
> nqkakva komanda kym sistemata:
> bash: fork: resourse temporaly unavailabel) , koeto e normalno :).
>
> Interesno mi e kakvo polu4avate vie i kak ste reagira root v takava
> sitruaciq... Razbira se root ne mozhe da pokazhe 4erven karton na haralampi
> samo za tova 4e se u4i da programira na C ili pravi podobni gluposti
> svyrzani s habene na system resources.
--
_______________________________________________
Get your free email from http://www.graffiti.net
Powered by Outblaze
===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|