LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Linux process limit (https://www.linuxquestions.org/questions/linux-general-1/linux-process-limit-242610/)

kangaman 10-14-2004 11:41 AM

Linux process limit
 
Hi.

I am looking for some assistance with Linux process limits.
When working in our computer lab on Operating Systems course assignments, students often write bad C programs that time up our time sharing systems -- the sort of "while(1) fork" equivalents. As a result, we added a process limit of 1024 processes to our system by modifying the /etc/security/limits.conf file. We tested that the the limit worked with our own forking program, and everything worked just fine. We were able to run a user up to his process limit. Any future attempts to login through any means of logging into our system for that user would not work. If the user had other windows already open on the system and tried to execute other commands, he would see "out of procesess". Today, we noticed that one student was running a forking program, and had over 7000 processes occupied. We do not understand how this program could get around the process limit. He certainly wasn't trying to get around the limit. Maybe someone could offer some feedback.. We are running a Linux 2.4.26 kernel.

In the process table, all of the processes looked like this:

040 D <u> 27811 1 0 69 0 - 359 down 09:45 ? 00:00:00 a.out
240 S <u> 3911 1 0 69 0 - 359 end 09:47 ? 00:00:00 a.out
040 S <u> 13205 12417 0 69 0 - 357 nanosl 09:48 ? 00:00:00 a.out
040 S <u> 14555 14346 0 73 0 - 357 wait4 09:48 ? 00:00:00 a.out

I would understand if all but 1024 of them were defunct/zombies but that's not the case.

Can anyone shed any light on what I might be missing?

Thanks for any help you can provide...

Tinkster 10-14-2004 01:22 PM

Which out-paramaters on ps were you using,
and can you add code-tags to the output to
make it more readable?




Cheers,
Tink

kangaman 10-14-2004 01:39 PM

ps tags
 
Hi Tinkster,

I was using just "ps -elf". Unfortunately I can't change the tags because what you see is the output that I captured from the
screen. We had to kill all the processes off to get our system back to normal again.

Tinkster 10-14-2004 01:53 PM

Code:


That's what I meant :}


Makes it more readable, giving the text a mono-spaced font.

Another question: did you look at the guys code?
Maybe he used a different function call than the
others ...


Cheers,
Tink

kangaman 10-14-2004 02:48 PM

Hi Tinkster,

No problem ... my first time on the site so I had to figure it out..

Code:

040 D user 27811    1  0  69  0    -  359 down  09:45 ?        00:00:00 a.out
240 S user  3911    1  0  69  0    -  359 end    09:47 ?        00:00:00 a.out
040 S user 13205 12417  0  69  0    -  357 nanosl 09:48 ?        00:00:00 a.out
040 S user 14555 14346  0  73  0    -  357 wait4  09:48 ?        00:00:00 a.out


The code isn't any different than any of the other students code really.. just messing up with fork().

Kangaman.


All times are GMT -5. The time now is 01:28 PM.