Cannot set user id: Resource temporarily unavailable

Source: Internet
Author: User
Tags metalink

Cannot set user id: Resource temporarily unavailable

A while ago, Infra reported that the database server could not be connected through putty and SecureCRT. The error message is Resource temporarily unavailable. Since there are almost 20 nstance on the server, it should be beyond the value currently set by the system. I have encountered this error before, but it is not this error, but open files: cannot modify limit: Operation not permitted. The following describes the error "Resource temporarily unavailable" and related information.

I. Fault symptom

Installer @ linux_02: ~> Ps-U Oracle | wc-l

2015

Installer @ linux_02: ~> Lsof | grep oracle | wc-l

83646

Installer @ linux_02: ~> Su-oracle

Password:

Su: cannot set user id: Resource temporarily unavailable

# The following error occurs when you connect from Putty or SecureCRT:

Server sent disconnect message

Type 2 (protocol error ):

"Fork failed: Resource temporarily unavailable"

# System logs are as follows:

Aug 19 09:25:01 linux_02/usr/sbin/cron [6736]: (oracle) MAIL (mailed 25 bytes of output butgot status 0x0001)

Aug 19 09:26:29 linux_02 sshd [6864]: Accepted keyboard-interactive/pam for oracle from 192.168.9.1 port 1253 ssh2

Aug 19 09:26:29 linux_02 sshd [6875]: fatal: setresuid 2000: Resource temporarily unavailable

Aug 19 09:27:15 linux_02 sshd [6922]: Accepted keyboard-interactive/pam for oracle from 192.168.9.1 port 1312 ssh2

Aug 19 09:27:15 linux_02 sshd [6985]: fatal: setresuid 2000: Resource temporarily unavailable

Ii. Fault Analysis

# The following is the error description of 788064.1 pair of Resource temporarily unavailable on Metalink:

The error is different when it is reaching the limit 'open files' and 'max user processs' in/etc/profile.

A). Error on reaching the limit 'open files ':

[Oracle @ mydesk ~] $ Ssh rac2

Oracle @ rac2's password:

-Bash: ulimit: max user processes: cannot modify limit: Operation not permitted

-Bash:/home/oracle/. bash_profile: Too program open files

B). Error on reaching the limit 'max user processs ':

[Oracle @ mydesk ~] $ Ssh oracle @ rac2

Oracle @ rac2's password:

-Bash: ulimit: open files: cannot modify limit: Operation not permitted

-Bash: fork: Resource temporarily unavailable

# That is to say, our current error is caused by the number of processes. # Author: Leshami

# Check the current limits. conf configuration below # Blog: http://blog.csdn.net/leshami

Linux_02:/etc/security # grep-v ^ #/etc/security/limits. conf

Oracle soft nproc 2047

Hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

# The following is an official SUSE Resolution:

The affected user has reached the maximum number of process specified for him into the file/etc/security/limits. conf.

These commands, executed as root, can give you the number of process and of open files for the given user:

Ps-U username | wc-l

Lsof | grep username | wc-l

To fix the issue increase the NPROC Soft limit according to the user and applications needs; please look at the note below about the/etc/security/limits. conf file.

# The above description also adds the nproc value,

# From the ps and lsof commands used earlier, the number of processes of oracle users obtained by the ps command is 2015. From this value, the current configuration meets the requirements.

# The number of opened files exceeds the set hard value, which is 83682. I wonder if the number of files is incorrect, but the number of processes is incorrect.

# ID 788064.1 provides the following solution:

A). Modify/etc/security/limits. conf manually

Increase the value of 'soft nofile' until it is equal to 'hard nofile' value. Increase the value of 'soft nproc' until it is equal to 'hard nproc' value.

# Add the soft nofile value to the hard nofile value; Add the soft nproc value to the hard nproc value.

# From this point of view, the soft value should be allocated once the system starts, but the maximum value cannot exceed the hard value. A soft value is assigned no matter whether the system is idle or not.

B). Install oracle-validated package to modify/etc/security/limits. conf # Install oracle-validated to automatically modify limits. conf (applicable to RHEL4 to OL5)

After install the oracle-validated package, the content of/etc/security/limits. conf is modified.

# The description on Metalink ID 1239915.1 also needs to be adjusted to limits. conf.

SOLUTION

The file/etc/security/limits. conf controls the resource limits for each user.

The nproc value determines how many processes that user is allowed and the nofile value limits the total number of files which may be opened at once.

Increase both the soft and hard limits for the destination user ("oracle" in our example) and save the file.

Activate The Changed User Limits

These changes take effect only upon login, so out and re-login to activate the changes.

Iii. troubleshooting

# Adjust the limits. conf file according to the above Solution

Linux_02:/etc/security # cp limits. conf limits. conf. bk

Linux_02:/etc/security # vi/etc/security/limits. conf

Linux_02:/etc/security # grep-v ^ #/etc/security/limits. conf

Oracle soft nproc 16384

Hard nproc 16384

Oracle soft nofile 65536

Oracle hard nofile 65536

Oracle @ linux_02:/users/oracle> ps-U oracle | wc-l

2714

Oracle @ linux_02:/users/oracle> lsof | grep oracle | wc-l

110694

Iv. References

Ulimit: open files: cannot modify limit: Operation not permitted

DocID: 1239915.1.

DocID: 788064.1.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.