LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-24-2002, 10:22 AM   #1
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Rep: Reputation: 0
Unhappy Help! Forking errors!


I've got some problems. Here's the situation: upgraded an old RedHat 6.1 machine, some new hardware and installed RedHat 7.2. I've got about 120-130 users on this machine and several databases of info. Problem is in the morning when everyone is logging on I start getting all of these ksh: cannot fork errors or fork: cannot allocate memory, when trying to do just about anything: (ie. ls, who, uptime, top). At first I thought that it might be swap space, but I have twice my RAM at 2.0G. Then I thought that it might be the number of instances in telnet for xinetd, so I made it unlimited. I am still having the problem, but it only seems to be in the morning. Has anyone had this problem before? Thanks in advance for your help.
 
Old 04-24-2002, 10:26 AM   #2
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
check ulimits again

You mention that you've changed your ulimits -- you may have to check that it's taking effect and that something isn't changing it back on you.

How many processes are running on the system in the morning? With that many users and all those databases you may just be running out of pids. I believe there are 64-bit pid patches for the kernel and system libraries.
 
Old 04-24-2002, 10:32 AM   #3
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Original Poster
Rep: Reputation: 0
Post More info

Here is something from /var/log/messages:

Apr 24 08:25:37 copper xinetd[9273]: telnet: fork failed: Cannot allocate memory (errno =12)
Apr 24 08:25:37 copper xinetd[9273]: service telnet: too many consecutive fork failures
Apr 24 08:25:38 copper xinetd[9273]: pop3: fork failed: Cannot allocate memory (errno = 12)

Here is the top when this is happening (sorry for the mess):

8:28am up 12 days, 22:53, 58 users, load average: 0.26, 0.18, 0.11
656 processes: 655 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 0.3% user, 0.2% system, 0.0% nice, 99.0% idle
CPU1 states: 2.0% user, 2.0% system, 0.0% nice, 95.3% idle
Mem: 1028412K av, 1021992K used, 6420K free, 192K shrd, 62576K buff
Swap: 2040244K av, 0K used, 2040244K free 540496K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
19783 mitchsi 15 0 1428 1428 836 R 3.0 0.1 0:00 top
19786 valerca 10 0 1816 1816 1156 S 0.5 0.1 0:00 fglgo
19787 valerca 10 0 1504 1504 1256 S 0.5 0.1 0:00 sqlexec
19333 alicihe 10 0 1896 1896 1212 S 0.3 0.1 0:00 fglgo
200 root 10 0 0 0 0 SW 0.1 0.0 0:07 kjournald
19600 kimmc 9 0 1864 1864 1216 S 0.1 0.1 0:00 fglgo
19732 root 9 0 820 820 684 S 0.1 0.0 0:00 in.telnetd
1 root 8 0 520 520 452 S 0.0 0.0 0:07 init

And finally from xinetd.conf:
#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
instances = 100
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}

includedir /etc/xinetd.d

Hope this helps you help me!
 
Old 04-24-2002, 10:45 AM   #4
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Original Poster
Rep: Reputation: 0
Post

I don't think I changed ulimits, just the file telnet under /etc/xinetd.d, then I restarted xinetd. Maybe that was what you were referring to? Well I check the file and the change is still there. Also I'm not so sure that it would be processes, as you can see from my top there are around 650 right now (during the problem), but I have had well over 1300 on the machine at times with no problems what so ever. It's an annoying problem.
 
Old 04-24-2002, 11:01 AM   #5
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
ulimits

Offhand what are the limits for the system? (ulimit -Ha and ulimit -Sa)

can you simulate the problem (like a controlled DoS attack) at all? What are the /proc/sys/fs/file-nr and inode-nr values normally and in the morning? What is swap usage like? (/proc/meminfo)

Sorry for all the questions but this one is intriguing. :-)
 
Old 04-24-2002, 11:23 AM   #6
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Original Poster
Rep: Reputation: 0
Post

No problem, interest is good.

Here is output from ulimit -Ha and -Sa:

mitchsi on copper.bdsn.com = > ulimit -Ha
time(cpu-seconds) unlimited
file(blocks) unlimited
coredump(blocks) 0
data(kbytes) unlimited
stack(kbytes) unlimited
lockedmem(kbytes) unlimited
memory(kbytes) unlimited
nofiles(descriptors) 1024
processes 4095

mitchsi on copper.bdsn.com = > ulimit -Sa
time(cpu-seconds) unlimited
file(blocks) unlimited
coredump(blocks) 0
data(kbytes) unlimited
stack(kbytes) unlimited
lockedmem(kbytes) unlimited
memory(kbytes) unlimited
nofiles(descriptors) 1024
processes 4095

We thought maybe it had something to do with mail (people checking mail in the morning), but we can't seem to replicate it once it has gone away (the machine's fine now by the way).

file-nr: 23885 7055 49152
inode-nr: 153647 0

And right now meminfo says that swap is not being used up:

total: used: free: shared: buffers: cached:
Mem: 1053093888 1042399232 10694656 196608 30420992 452923392
Swap: 2089209856 0 2089209856
 
Old 04-24-2002, 12:36 PM   #7
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
This one's a stumper

I was doing some reading on forking problems but everything points to memory (apparently the error really is telling the truth, go figure) :-)

I was hoping it was something simple like running out of inodes or file descriptors and the error message was just wrong, but some research seems to go against this idea. You sure seem to have a lot of activity on that system though with inode #s like that!

I can only suggest turning off swap, running mkswap -c on the swap partition. You've been warned: 2G will take a while to check. :-)

From what I've been reading this can be caused when the virtual memory system has been corrupted (bad blocks on swap, etc.) -- what is the kernel and uptime of the machine?
 
Old 04-24-2002, 03:24 PM   #8
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Original Poster
Rep: Reputation: 0
Post

Hmmm....I may have to try that, with the mkswap -c, problem is I don't want to disrupt users and I don't want to reboot if I don't have to.

Current uptime is 13days, 77 users, load avg. 0.21, 0.18, 0.18

Thanks for all of your help, btw.
 
Old 04-24-2002, 04:24 PM   #9
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
You don't have to reboot

Since swap isn't doing any good anyway (and you have none used, which is VERY odd if it was turned on at boot) then swapoff -a won't disrupt anyone, and the mkswap/swapon -a won't affect anyone. (unless it's on the same channel as your main drive, in which case go dunk your head in a toilet and fix it.)

I'd let it run overnight, you shouldn't have any troubles.

aside: normally when there is no memory init (I think it's init, it may be the kernel itself) will kill off the biggest memory hogs in sequence to free up memory so the whole fork error is strange to begin with.

aside 2: the reason I say it's very odd that 0 bytes of swap are used (assuming it was turned on at boot) is because Linux will push less-used pages to swap when it runs out of memory, but it will NOT page them back in until they're needed. That almost ALWAYS means that once some swap is used, there is always some showing as used. I wouldn't mind seeing a pagein daemon that gently pages things back in if memory is free, since at least on desktops you end up with a big delay because vmware got paged out since you were doing a compile or something. :-)
 
Old 04-25-2002, 11:58 AM   #10
strider
LQ Newbie
 
Registered: Apr 2002
Location: Everett, WA
Distribution: RedHat 7.2
Posts: 10

Original Poster
Rep: Reputation: 0
Arrow

Well I broke down and called RedHat Linux support. Their response was that it is a problem with the kernel that I am running. We were running the Enterprise kernel, which I guess is optomized for over 4GB of memory. We should be using the SMP kernel. I think this may be the solution as the machine that is working is running SMP, but the two which are not are running Enterprise. I will be rebooting the machines at lunch and crossing my fingers.
 
Old 04-25-2002, 12:22 PM   #11
akohlsmith
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 114

Rep: Reputation: 15
One of the reasons I dislike RedHat

... Custom frikkin' kernels. UGH I never even thought to ask about that.

Good luck, I hope this solves your problem!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
piping /forking geminigal Programming 3 04-10-2005 09:49 PM
Linux Forking? linuxmania Linux - Distributions 3 04-07-2005 12:59 PM
Forking is very slow jspenguin Linux - General 2 05-29-2004 02:03 PM
Forking and multiprocessors sniff Programming 4 02-18-2003 05:28 PM
need help forking pings penguinboy Programming 2 09-12-2002 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 PM.

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