LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-04-2010, 12:33 AM   #1
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Rep: Reputation: 16
"fork: Resource temporarily unavailable" for certain user


Dear all.
I have a machine running on RH with 4G memory and 8G swap.
Just now I'm having a problem when loging in with a user - just call it "userX" -.

Each time I'm logged in I got a message
Code:
-bash: fork: Resource temporarily unavailable
And almost everytime I entered any command, it gives me the same warning. In some time (rarely) it will give me proper result, but almost any time it gives me the warning and no result.

When I use 'top' command, it shows that I still have 500M free memory and about 8G free swaps. Plus the process for userX is less than 20 processes, and each of them are short processes (less than an hour, mostly just few seconds).

As a note this problem only occur on userX, for any other user on the machine everything works just fine.

PS. my box is a web server, and mostly CPU load about 50%.

Any ideas welcome


Regards,

YoChan

Last edited by yoachan; 01-04-2010 at 12:36 AM.
 
Old 01-04-2010, 03:28 AM   #2
acaetano
LQ Newbie
 
Registered: Oct 2005
Distribution: centos
Posts: 3

Rep: Reputation: 0
running into resource limits

Check the output of ulimit -a
This will list the number of processes/files you have start/have open. You are likely running into this number.

Also see /etc/security/limits.conf and /etc/security/limits.d/ for resource limits configured by pam_limits.so per user. In this file you can configure the particular user's limits higher, but you have to logout and in for this to take effect.
 
1 members found this post helpful.
Old 01-04-2010, 03:48 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
There are other resources besides memory. The number of open files. The number of locks. The maximum filesize. The maximum stacksize.

You may want to check the limits.conf file as already suggested. Also check the files in the users home directory. I've had ~/.xsession errors grow to an extremely large size due to one of earlier KDE 4 programs.

Also read your kernel log. It probably will indicate exactly which resource limit was reached.
 
1 members found this post helpful.
Old 01-04-2010, 10:17 PM   #4
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Thanks for the replies.
I think it answered my question.

Code:
...
max user processes              (-u) 20
...
Only 20 processes per user.... (sigh)

Currently the issue stopped, but still should I change it to a bigger number?
 
Old 01-05-2010, 08:25 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Do you regularly use more than 20 processes per user? Yes? Yes.
 
1 members found this post helpful.
Old 01-05-2010, 09:58 AM   #6
kschmitt
Member
 
Registered: Jul 2009
Location: Chicago Suburbs
Distribution: Crux, CentOS, RHEL, Ubuntu
Posts: 96

Rep: Reputation: 23
That greatly depends on who has accounts on the box, and how it's used.

If you're the sysadmin, and you don't run any automated jobs that may run amuck, I'd sys up it to something reasonable. For a box that has a lot of concurrent console users 20 actually isn't unreasonable, but it could be low for "real" work. If it's console only, maybe up it to 64, if you use a graphical desktop on it maybe 128. If you're writing or using code that forks a lot, you could go 64k. Heck, you could go unlimited, but if this is a production box, that means anything run with your account could kill the system with a forkbomb, etc.

Do you know why it's set so low currently?
 
1 members found this post helpful.
Old 01-06-2010, 08:46 PM   #7
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Sorry for my late reply, and thanks again for the replies.

@AlucardZero: Sometimes, YES. Weekly one of my user use webalizer, and opens it several instance. Each instance eats one process. When she do her job, there will be no spare process left for me to do some work for the server maintenance. But as long as I stay away from the server than it's all fine

@kschmitt: I don't know when, and how. It's an artifact server. I think (IMHO) 20 is way too small. But in most cases we don't work directly in this server for it's a web server. And web request (AFAIK) handled by user "nobody" so basically as I said to AlucardZero 20 is enough as long as no one lay his feet on the server while it's working it's regular job.

PS. can anyone tells where can I read my kernel log? I want to check what it said about this problem.

Last edited by yoachan; 01-06-2010 at 08:50 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fork: resource temporarily unavailable ??? str8edge Linux - General 3 06-21-2011 09:00 AM
"FUTEX WAIT EAGAIN (Resource temporarily unavailable )" jungbg Linux - Newbie 1 12-22-2009 05:07 PM
termios /dev/ttyUSB0 "resource unavailable" nanoo Programming 4 07-14-2009 09:53 AM
./configure: fork: Resource temporarily unavailable doodlebug Linux - Server 3 08-23-2007 03:34 PM
Cifs "mount error 11 = Resource temporarily unavailable" humbletech99 Linux - Networking 1 09-26-2006 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration