Originally Posted by PTrenholme
Perhaps the OPs problem is as simple as changing the ulimit -n value for his shell (if his distribution permits it). From the manual page:
Note that it's implied that this is a "per-process" limit, so a simple ctrl-alt-f2 to start a new tty session might be all that's needed. (Provided that the OP is not in an X-session with VTSwitch turned off, which is the default setting in newer Xorg releases.)
I agree that the ulimit command may provide some relief, but if you have one user that's running a script that causes your entire system to become shaky, I think it would be more prudent to examine that script and what it does (and HOW it does it), than putting a temporary fix in place. Granted, that may be the ONLY option you have left after examining the situation, but looking at that script/user should be the first step.
I've written several things that vary wildly, depending on the execution. Just recently, I did a fairly complex MySQL query (joining on multiple tables across databases, etc.). One way took about 2 minutes...re-ordering the query and changing some things around brought it to less than a second, for the same results. Trying to speed up the DB server to address that speed problem would have been one thing to look at, but looking at the first piece (the query), was easier and resolved the problem.