Ulimit -p
Oracle documentation 10.2, Linux 4
Depending on the oracle user's default shell, make the following changes to the default shell start-up file:
For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the file on SUSE systems)/etc/profile.local:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
Result
[oracle@localhost ~]$ ulimit -p 16384
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
???
1. You are using Bash shell (not ksh), so the message "-bash: ulimit: pipe size: cannot modify limit: Invalid argument" is pretty clear and valid because "uname -p 16384" is not valid for Bash.
2. Now check the shell condition in script above.
It says that if user's shell is "ksh" then it will execute "uname -p 16384" otherwise it will execute "ulimit -u 16384 -n 65536" (which is valid also for bash).
So you need to use "ulimit -u 16384 -n 65536" command.
I suggest you to copy whole script to /etc/profile because non-privileged user can't change some limits.
Similar Messages
-
Ulimit "cannot modify limit" error when starting Apache
This isn't exactly an OSX Server problem, but I am trying to start Apache and subsequently Tomcat on my MacBook Pro so I can locally test a website before I deploy it to our test server. (The MacBook is a new machine to which I recently migrated my setup from my old PowerBook. The PowerBook is running 10.4.11, FWIW, and all worked well there.)
When I do this from the command line:
sudo /Library/Apache2/bin/apachectl start
I get:
/Library/Apache2/bin/apachectl: line 70: ulimit: open files: cannot modify limit: Invalid argument
And Apache is not started. This runs fine on my old machine. The culprit line from apachectl is:
ULIMITMAXFILES="ulimit -S -n `ulimit -H -n`"
Just running the'ulimit -H -n' yields 'unlimited'.
What's the problem here, and how do I fix it? I haven't found the answer by Googling.Back up all data.
Select
Shell ▹ New Command
from the Terminal menu bar. Copy and paste the following line into the text box that opens:
mkdir disabled_shell_files; mv .profile .bash* $_
Your old shell initialization and history files will be saved in a directory with the indicated name at the top level of your home directory. Test. -
Ulimit and launchctl both fail to restrict maximum file size
I've submitted a bug report, but I figured I'd open this up to the community. I can't seem to find any way to set restrictions on the maximum file size that can be created on OS X. I've tested both Snow Leopard and Lion.
*** Ulimit method:
$ ulimit -f 100000
$ ulimit -f
100000
$ dd if=/dev/zero of=/tmp/zero
Filesize limit exceeded: 25
$ ls -al /tmp/zero
-rw-r--r-- 1 admin wheel 102400000 Jul 5 08:23 /tmp/zero
$ ulimit -f
unlimited
*** launchctl method:
$ launchctl limit filesize 100000
$ launchctl limit filesize
filesize 100000 100000
$ dd if=/dev/zero of=/tmp/zero
dd: /tmp/zero: No space left on device
54883985+0 records in
54883984+0 records out
28100599808 bytes transferred in 683.205935 secs (41130497 bytes/sec)
$ ls -al /tmp/zero
-rw-r--r-- 1 admin wheel 28100599808 Jul 5 08:36 /tmp/zero
$ launchctl limit filesize
filesize unlimited 100000
In the first case, a limit does get set. But when the first launched application returns control back to the terminal, the limit gets reset back to "unlimited". In the second case, launchctl does appear to list a soft and hard limit for "filesize", however it does not stop dd from filling up the disk. Running launchctl again shows an "unlimited" soft limit, but the hard limit remains.
I've even tried setting a persistent, global limit via /etc/launchd.conf. launchctl reports this limit, however there is nothing stopping huge files from being created.
I do think that this is a bug on OS X, but perhaps there's something I'm overlooking? If it is a bug, is there some workaround that I can use?
Thanks
-WDThere are no file size limits to the software beyond what would be imposed by the operating system itself and the file format of the drive.
So...assuming you have enough drive space, something else is going on. -
What's the semantic of "max user processes" (ulimit)
Hello everyone,
I don't understand the behaviour of ulimit, have a look at this shell dump:
$ ps hax | wc -l
120
$ ps h -u myUsername | wc -l
35
$ ulimit -Su 78
$ ps h -u myUsername | wc -l
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: Resource temporarily unavailable
$ ulimit -Su 80
$ ps h -u myUsername | wc -l
35
$
If I am currently running 35 processes, one would assume that >35 more should be sufficient to start two more processes - but obviously it isn't.
In this case, I needed at least "ulimit -Su 80" to start ps and wc.
If I set the "max user processes" limit to 79, the first four error messages change from "bash: fork: retry: No child processes" to "bash: fork: retry: Resource temporarily unavailable"
Can somebody explain this bevahiour to me, please? Why am I not allowed to create new processes, although the limits should be sufficient?Apologies for the necro-bump but I hope this will help others.
ulimit -u does not give you the max number of processes rather it displays the max number of threads. To list the number of threads a user is currently using:
ps -L -u myusername | wc -l
The output from the above two commands can now be compared and allow you to set the appropriate ulimit. -
Oracle-validated rpm and ulimit values
OS: Oracle Linux 5.6 (VirtualBox)
I'm somewhat puzzled over the Oracle 11gR2 installation instruction and the "oracle-validated" rpm package.
According to the Oracle installation instruction for Linux at http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/pre_install.htm#BABIAIED
The following values are recommended minimum:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240 (32768 KB at most)
The oracle-validated package modifies /etc/security/limits.conf as following:
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock 50000000
oracle hard memlock 50000000
From what I understand, these values are maximum limits. I assume the "oracle-validated" package is not just only for Oracle 11g, and the Oracle 11g documentation recommends values, assuming you do not want to set it to unlimited? Is this correct?
Btw, the Oracle supplied $ORACLE_HOME/bin/osh utility to check and raise the ulimit to the maximum, actually sets ulimit to 1056837 with the oracle-validated package installed, but it is not run unless ulimit does not return "unlimited" or is less than 2113674. The osh utility is run by oraenv.It seems there is no real answer to it, or there is no issue as such. I'm marking this thread as answered. I have come to the following conclusion:
Oracle-validated configures /etc/security/limits.conf which sets the upper limits per login. It is up to the user to decide the actual limits. The Oracle installation instructs to set ulimit -u 16384 -n 65536 for the Oracle user, which is certainly within the upper limits of limits.conf.
I notice however that the default stack size is smaller than recommended. i.e. 8192.
/etc/profile (add ulimit -s)
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
ulimit -s 10240
else
ulimit -u 16384 -n 65536 ulimit -s 10240
fi
fiI think setting the values to unlimited is probably not the best idea.
Edited by: Dude on Jul 28, 2011 5:47 PM -
Why ulimit fails for stack size in Sol 10 update 11 with project settings?
Hi,
The following command fails on Solaris 10 update 11 platform. It works fine with update 10. Something has changed in update 11. Any ideas?
ulimit -Ss 1 (or any number for that matter)
/bin/ksh: ulimit: exceeds allowable limit
We have the following setting in project as well.
process.max-stack-size=(basic,137988707188736,deny)
process.max-stack-size=(priv,137988707188736,deny)
Thanks for your help in advance.
SamyHere are the values from the project command if you anyone is wondering
update 10
======
cat /etc/release
Oracle Solaris 10 8/11 s10x_u10wos_17b X86
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Assembled 23 August 2011
prctl -n process.max-stack-size $$
process: 10189: /bin/ksh -i
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-stack-size
privileged 125TB max deny -
system 125TB max deny -
update 11
======
cat /etc/release
Oracle Solaris 10 1/13 s10x_u11wos_24a X86
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Assembled 17 January 2013
prctl -n process.max-stack-size $$
process: 24776: /bin/ksh -i
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-stack-size
basic 125TB - deny 24776
privileged 125TB - deny -
system 125TB max deny - -
Solaris 10_x86(64bit) VM -- ulimit changes do not survive a reboot
I originally resurrected an older abandoned thread:
make ulimit changes permanent
but a kind forum moderator has split my post away so that it stands on its own merits instead of distracting from that person's earlier issue.
My issue is ...
I am in need of changing the default stack size as reported by ulimit -s on a Solaris 10 x86_64 VM however the changes suggested to /etc/system do nothing on reboot to what is reported by ulimit -s.
My current ulimit -s is 10240 but according to the oracle 11g installation docs on page 2-19 (Configure Shell Limits) they recommend you change the value reported by ulimit -s to be 32k (or 32768).
Putting the following in /etc/system does nothing to that value after a reboot:
set lwp_default_stksize=0x8000
I also tried:
set lwp_default_stksize=32768
as according to the documentation it is an integer value. Same result though...eg: no change to the value of ulimit -s after reboot.
http://docs.oracle.com/cd/E19455-01/816-0607/6m735r5f7/index.html
What cold the problem be?You are comparing apples to oranges. lwp_default_stksize defines the <b>kernel</b> stack size. ulimit -s defines the process stack size and each process has it's own stack.
The way I handle it is I have a /etc/init.d/oracle init script that starts the Oracle DBs. In the script I have these lines at the top:
<pre>ulimit -n 4096
ulimit -s unlimited</pre>
And the same in the oracle owner's .profile. Seems to work for me.
On my Linux hosts, I have the following code in the Oracle init.d script and the oracle owner .bashrc:
<pre>##########
# increase limits to hard limits for maxmem, maxmemlock, stacksize,
# nfiles, nprocmax
declare -a ULIMITLST=(-m -l -s -n -u)
for i in ${ULIMITLST[@]}
do
ulimit $ `ulimit ${i} -H`
done</pre> -
I'm trying to increate the ulimits for max user processes and open files for the oracle user. I've set the values in limits.conf, /etc/profile and in oracle's environment scripts. Now when I log in as oracle I get the below errors. If I change the ulimits back to the original values errors go away but ulimits aren't changed.
login as: oracle
[email protected]'s password:
Last login: Fri Mar 6 09:56:02 2015 from mtkadmin12
You are logging onto an Oracle system.
Kickstarted on: 2014-06-05
-bash: ulimit: max user processes: cannot modify limit: Operation not permitted
-bash: ulimit: max user processes: cannot modify limit: Operation not permitted
[oracle@servername ~]$Thanks for the update.
I modified the /etc/security/limits.d/90-nproc.conf and added a line for oracle and also modifed the oracle.sh file. The ulimits are setting correctly when I su - oracle but they are still wrong when sshing in as oracle.
[root@mtkdevorap11d-1 ~]# su - oracle
[oracle@mtkdevorap11d-1 ~]$ ulimit -Ha
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1030982
max locked memory (kbytes, -l) 94371840
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[oracle@mtkdevorap11d-1 ~]$
[oracle@mtkdevorap11d-2 ~]$ ssh mtkdevorap11d-1
Last login: Mon Mar 16 13:04:16 2015 from mtkdevorap11d-2.conveydev.com
You are logging onto an Oracle system.
Kickstarted on: 2014-06-05
[oracle@mtkdevorap11d-1 ~]$ ulimit -Ha
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1030982
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[oracle@mtkdevorap11d-1 ~]$ -
Need of changing the default stack size permanently as reported by ulimit -
Hi All,
In order to install proper 11gr2 on solaris 10 I need to make change of stack size permanently.
My current ulimit -s is 8192 but according to the oracle 11g installation docs (Configure Shell Limits) they recommend you change the value reported by ulimit -s to be 32k (or 32768).
I can change this value usiing "ulimit -s 32768" but after reboot of sever this value alwayes change back to old value(8192).
I tried to do that in /etc/projects but not able to make this permanent, How to make stak size permanently in solaris 10.
I am on ...
Oracle Solaris 10 8/11 s10s_u10wos_17b SPARCHi;
I suggest please review:
http://serverfault.com/questions/21417/how-to-set-ulimits-in-solaris-10
It seems that parameter will lost after server reboot. SoThe above settings are not permanent and will be lost after the reboot of the server. To make the changes permanent you need to set this in the respective user profile file. (For ex : .bash_profile on linux)
Please review:
Connecting Using: sqlplus "/ as sysdba" Fails with ORA-12547 with Lower Ulimit Setting [ID 878375.1]
Regard
Helios -
Hi..
Please help me to change ulimit values of Oracle user in AIX server.After changing ulimit values,any need to restart any services for effecting these values???
ThankssssNo re-start required
Ulimit Value
make ulimit changes permanent -
How to increase ulimit max open files, permanently?
I have a shell script that needs to be able to receive hundreds of incoming socket connections. The default max of open files is 256. Strangely, if I run:
sudo ulimit -n 800
...ulimit -a still shows just 256 max open files. If I become root (sudo su), then I can increase the max files to 800, but that setting only remains while I'm root user.
Anyone know how to increase the max open files setting for my regular user name, as I run scripts from the Terminal bash shell?
...ReneWow, within 2 minutes, I realized what I had to do, so in case anyone else wonders the same, here's the solutions:
Just edit the .bash_profile file in your home directory (create it if it's not already there), and add the line:
ulimit -n 1024
Now, whenever you start terminal, that process will be able to open up to 1024 files or socket connections.
...Rene -
How to set -Xss or ulimit for Oracle Http Server
Hi,
We are facing Out of Memory Error in OHS 11g in our cluster environment. Where I can see below statements in http log file:
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
# Out of Memory Error (gcTaskThread.cpp:46), pid=17956, tid=140591807985408
When I run the ulimit command on machine, stack size is showing as 10MB:
Result:
[oracle@XXXXXX bin]$ ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1031958
max locked memory (kbytes, -l) 3500000
max memory size (kbytes, -m) unlimited
open files (-n) 131072
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 131072
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Setting the stack size to 512KB or 256KB might resolve the problem.
I tried setting ulimit -s 512 in my user bash_profile. and ran ulimit -a , then it is showing as
stack size (kbytes, -s) 512
If I set at user level, does it have any impact? Or we should set at JVM level using -Xss
Can some body tell me where can I set -Xss for Oracle HTTP server 11g?
Regards,
VidyaHi Marco,
I believe you'll need to setup a MX record under 'More Actions' for your domain in Site Settings / Site Domains.
Select the option "Use another external service for email" and enter your primary mail server's hostname at priority 10.
Think you can repeat this step for your secondary mail server (priority 20) if you have one.
Regards
Mike -
Hi;
I writed one sh which is checking tablespace size and its working well ( i used this before for someother client) Now i try to run it on one server and i have this error:
/etc/profile: line 28: ulimit: max locked memory: cannot modify limit: Operation not permitted in /var/spool/mail/root
Anyone has idea what is problem?
ThanksWell, check line 28 of /etc/profile, and see what command it is trying to execute. If it's a ulimit -l command, check if the value it is trying to set the limit to is higher than the current ulimit value of the current user. If it is, then that operation is not allowed. You can increase the limit for the current user (at login time) by modifying /etc/security/limits.conf . This is documented in the various guides, notes, whitepapers that talk about installing Oracle database on Linux.
-
-bash: ulimit: max user processes: cannot modify limit: Operation not permi
Hi,
Installed 10g Forms&Reports only on RHEL 3ES.
Modified /etc/profile according to Oracle's documentation:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -n 16384
ulimit -p 16384
else
ulimit -u 16384 -n 16384
fi
fi
But when I logon to the server, the following message shows:
"-bash: ulimit: max user processes: cannot modify limit: Operation not permitted"
What is the problem here?
Thanks
StephanHi,
Installed 10g Forms&Reports only on RHEL 3ES.
Modified /etc/profile according to Oracle's documentation:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -n 16384
ulimit -p 16384
else
ulimit -u 16384 -n 16384
fi
fi
But when I logon to the server, the following message shows:
"-bash: ulimit: max user processes: cannot modify limit: Operation not permitted"
What is the problem here?
Thanks
Stephan -
-bash: ulimit: open files: cannot modify limit: Operation not permitted
Hi all,
i´m preparing a linux 64bits environment to install Oracle 10g R2. I´m following the installation manual and there say that:
Depending on the oracle user's default shell, make the following changes to the default shell startup file:
For the Bourne, Bash, or Korn shell, add the following lines in the /etc/profile file (or the /etc/profile.local file on SUSE systems):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
Ok, I did it, so when execute the follow comand I get a error like this.
tetis:/etc # su - oracle
-bash: ulimit: open files: cannot modify limit: Operation not permitted
oracle@tetis:~>
Can anybody help me ?
Regards,
Wander (Brazil)The limits for -u and -n are defined in limits.conf, it looks like the -n section is not working (-u is already 16384), just to double check, show us the output for:
$ more /etc/security/limits.conf | grep oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
$ more /etc/pam.d/login | grep pam_limits
session required pam_limits.soEnrique -
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
Followed the Oracle documentation to install Oracle 10g R2 on RedHat 4(UP1) x86-64 and I'm getting the following error when I login to the server from a putty client:
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
Can someone explain why I'm getting this error and if there is a way to fix it?
Thanks,
DeniseHi!
Just delete changes in /etc/profile and make changes as shown here in file /etc/security/limits.conf.
Read this article:
Limiting Maximum Number of Open File Descriptors for the Oracle User
After /proc/sys/fs/file-max has been changed, see Setting File Handles, there is still a per user limit of maximum open file descriptors:
$ su - oracle
$ ulimit -n
1024
$
To change this limit, edit the /etc/security/limits.conf file as root and make the following changes or add the following lines, respectively:
oracle soft nofile 4096
oracle hard nofile 63536
The "soft limit" in the first line defines the number of file handles or open files that the Oracle user will have after login. If the Oracle user gets error messages about running out of file handles, then the Oracle user can increase the number of file handles like in this example up to 63536 ("hard limit") by executing the following command:
ulimit -n 63536
You can set the "soft" and "hard" limits higher if necessary.
NOTE:
I do not recommend to set the "hard" limit for nofile for the oracle user equal to /proc/sys/fs/file-max. If you do that and the user uses up all the file handles, then the entire system will run out of file handles. This could mean that you won't be able to initiate new logins any more since the system won't be able to open any PAM modules that are required for the login process. That's why I set the hard limit to 63536 and not 65536.
That these limits work you also need to ensure that pam_limits is configured in the /etc/pam.d/system-auth file, or in /etc/pam.d/sshd for ssh, /etc/pam.d/su for su, or /etc/pam.d/login for local logins and telnet if you don't want to enable it for all login methods. Here are the two session entries I have in my /etc/pam.d/system-auth file:
session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.so
Now login to the oracle user account since the changes will become effective for new login sessions only. Note that the ulimit options are different for other shells.
$ su - oracle
$ ulimit -n
4096
$
The default limit for oracle is now 4096 and the oracle user can increase the number of file handles up to 63536:
$ su - oracle
$ ulimit -n
4096
$ ulimit -n 63536
$ ulimit -n
63536
$
To make this change permanent, you could add "ulimit -n 63536" (for bash) to the ~oracle/.bash_profile file which is the user startup file for the bash shell on Red Hat Linux (to verify your shell execute echo $SHELL). To do this you could simply copy/paste the following commands for oracle's bash shell:
su - oracle
cat >> ~oracle/.bash_profile << EOF
ulimit -n 63536
EOF
To make the above changes permanent, you could also set the soft limit equal to the hard limit in /etc/security/limits.conf which I prefer:
oracle soft nofile 63536
oracle hard nofile 63536
Maybe you are looking for
-
How to find document attached to user and Company code?
Hi all, Requirement: Select a list of Business documents ( Sales order/PO....) created or changed by <b>specific users</b> which belong to a <b>Specific Company code</b>. ie,To develop a report which lists the Documents created/updated/changed based
-
Goods Receipt against Purch Order with WBS not posted qty in Project Stock
Dear Gurus We have recently implemented SAP in our company. One problem which we have encountered is at the time of GR of material against Purchase Orders with WBS assignments. Our requirement is that the goods at the time of GR should undergo the QM
-
each time I launch the application in order to download a trial of indesign, the creative suite shuts down. what should I do?
-
How to execute the process chain using function module
Hi, How can we execute the process chain when there is any process failed. For ex. when we are running many processes. when loading fails in local process chain, after fixing this error, how can we execute the rest of processes. Can we execute the re
-
I'm trying to write an essay in MLA format, but I can't seem to indent the sentences. I've tried to hit Tab, but that doesn't seem to work.