Date: Mon, 28 Feb 2005 08:13:48 -0500 From: Coleman Kane <zombyfork@gmail.com> To: Ashwin Chandra <ashcs@ucla.edu> Cc: freebsd-hackers@freebsd.org Subject: Re: Fw: Priority Increasing Message-ID: <346a802205022805137ef19b48@mail.gmail.com> In-Reply-To: <000c01c51d51$ce6243b0$abe243a4@ash> References: <000c01c51d51$ce6243b0$abe243a4@ash>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 27 Feb 2005 20:56:03 -0800, Ashwin Chandra <ashcs@ucla.edu> wrote: > The forkbomb program I wrote is just one parent that forks 750 or so > children that each malloc around 40 MB's of memory and do a mem traversal > through it. The children do not fork. I see the overhead of forking could > be > causing this, but shouldn't there be some difference in the load of the > system when each forkbomb process is set to the lowest priority? To fork > 750 > processes would incur overhead until those processes are created (Which > shouldnt take much of real time) and once they are running, if they other > processes that have already been created are running "nicely", I don't see > why there is so much overhead too. > You are talking about malloc'ing almost 30GB of memory and having 750 readers paw through it to search for something. That is a lot of swap-backed memory. You are probably experiencing swap thrashing from all of this memory access/usage. Might I ask why this needs to be done 750 times in parallel? If you are trying to be efficient, try only forking off readers for each CPU, and waiting until they finish before you start anew. You also won't be swapping so much information to disk, which will make your program run alot faster than the method you are using. That is, of course, unless you actually do have > 30GB RAM. In that case, I am way off, but you may want to reduce the number of procs anyhow. > Do you recommend anotoher way to solve this forkbomb problem and keep the > system DoS free for others? > Ash > Also, this isn't really a forkbomb, as you seem to have a limit instituted on the number of forks. In a traditional fork-bomb, the forkers fork themselves, and so on, and so on, .... -- coleman kane
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?346a802205022805137ef19b48>