LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-25-2012, 07:55 AM   #1
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 542

Rep: Reputation: 36
Change kernel process number limits


I need to change the limits to the number of processes in Slackware 14, with the stock 32 bit kernel. Years ago this required a recompile of the kernel.

I am wondering if the (new) /proc feature (see how dated I am) or some other feature permits me to bump up the process limit on the fly.

Googling around, I find all kinds of reasons to have certain services limit the number of processes they can have, for security reasons, but I didn't stumble upon how to increase the limits for the kernel.
 
Old 11-25-2012, 08:08 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Rep: Reputation: Disabled
Check ulimit -h
 
Old 11-25-2012, 08:46 AM   #3
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by Didier Spaier View Post
Check ulimit -h
The issue is not user limits, but rather kernel limits. A ulimit of "unlimited" just takes one to the kernel limit, if one exists, as I recall.
 
Old 11-25-2012, 09:13 AM   #4
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 57
This thread is where I found the info: http://stackoverflow.com/questions/9...esses-in-linux

The answer there is:
Quote:
sysctl kernel.pid_max

or

cat /proc/sys/kernel/pid_max

As suggested by Ninefingers.

For completeness, you can change it temporarily by writing to /proc/syskernel/pid_max or permanently by adding:

kernel.pid_max = 4194303

to /etc/sysctl.conf. 4194303 is the maximum limit.
My upgraded-to-14 Slackware installation doesn't have a /etc/sysctl.conf, so I'm unsure what to do there. If creating one doesn't work then perhaps stuffing something like "sysctl -w kernel.pid_max=4194303" to rc.local, or perhaps "echo
>/proc/sys/kernel/pid_max 4194303" would work there as well. I dunno.

Good luck with it!

EDIT: When I tried the sysctl -w command on my 32-bit Slackware 14 it returned invalid argument errors for numbers > 32768.

EDIT2: Found the answer here: http://forum.soft32.com/linux/gentoo...ict333250.html
Quote:
On 9/16/06, darren kirby wrote:
> # sysctl -p
> error: "Invalid argument" setting key "kernel.pid_max"

You can find the answer in /usr/include/linux/threads.h.
PID_MAX_DEFAULT is defined as 0x8000 (32768) for most systems, and
PID_MAX_LIMIT is set to 4194304 *if* longs are larger than 4 bytes, or
PID_MAX_DEFAULT otherwise.

So if you are on a 32-bit system, you cannot set pid_max any larger
than PID_MAX_DEFAULT.

Last edited by jamesf; 11-25-2012 at 09:30 AM.
 
1 members found this post helpful.
Old 11-25-2012, 05:23 PM   #5
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 542

Original Poster
Rep: Reputation: 36
Thanks. How did you find that! I was looking all over stackoverflow, and found related stuff, but not that one. Looks like there might be another advantage of using a 64 bit kernel, if I understand the second part of your post correctly.
 
Old 11-25-2012, 05:53 PM   #6
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 57
Since you asked, I googled this phrase "linux kernel process number limit" and took a couple of the first hits (the list is different now, it would be the 1st and 3rd hits, I think).

Yes, 32768 seems the max for 32-bit kernels. You _could_ change it in the kernel source, but _I_ wouldn't try it since the setting is the single highest bit in a 32-bit word. I'd view that as probably related to word size and think that I'd likely break hard to find stuff somewhere else in the kernel.

YMMV, of course, and more searching might turn up a different answer.

good luck!

EDIT: I found the info for the second (32-bit limit) part by googling: "linux pid_max 32768 invalid argument"

Edit2: Note that if increasing the number of threads per process instead of the number of processes itself would help then this will tell you how to do it (NB: I haven't): http://stackoverflow.com/questions/3.../344292#344292

Last edited by jamesf; 11-25-2012 at 06:11 PM.
 
1 members found this post helpful.
  


Reply

Tags
kernel process limit


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to get service name(process name) by port number in kernel? pologuy Programming 3 04-17-2012 08:05 PM
How to get service name(process name) by port number in kernel? pologuy Linux - Networking 1 04-16-2012 10:40 AM
Limiting number of processes: /etc/security/limits.conf vs. /etc/ld.so.preload brianmcgee Linux - Server 2 01-10-2012 09:41 AM
I want to change the resource limits for a specific process thelast Programming 1 06-27-2010 03:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:26 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