Julian Elischer napisa:
Cheng Renquan wrote:
On Mon, Sep 7, 2009 at 6:59 PM, Ivan Radovanovic<riv...@gmail.com> wrote:
I was testing FreeBSD's behavior when running many threads at the same time (and I find it performs excellent) when I wanted to test how system will behave towards program that spawns itself too many times. I wrote a very
simple program
It's just the "fork bomb" problem, all operating system kernels cannot
deal with it well,

http://en.wikipedia.org/wiki/Fork_bomb
It's more a tuning problem I think. The system should tune itself so that MAXPROX is hit before critical resources are exhausted I think.
Having said that, there are a lot of resources that need to be watched.
After reading this nice article on wikipedia and learning about that bash one liner I wanted to check if it really works, but I didn't want to bring the system down again (and to create crash dump and so on), so I wanted to limit number of processes for single user and I did
sysctl kern.maxprocperuid=1000
as root, and after that I started bash and typed
:(){ :|:& };:
as normal user
First thing to notice - there was more than 4000 spawned bash processes (why if I set limit to 1000 per user id?), however system didn't crash and I was eventually able to recover with
/bin/kill -9 -- -1234
1234 being process group id of bash process

Regards,
Ivan

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to