Sponsored Content
Top Forums Shell Programming and Scripting Fork: Resource temporarily unavailable Post 302803755 by clx on Tuesday 7th of May 2013 10:28:48 AM
Old 05-07-2013
Ok. I will try that.

Regarding sar, the memory usage seems to be fine.

Code:
02:00:01 PM kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad
.
.
.
06:20:01 PM  39475812  26516060     40.18    198364   3490292  42605940  25420420     37.37         0
06:30:01 PM  39464752  26527120     40.20    200396   3534608  42605940  25420420     37.37         0
06:40:01 PM  39290188  26701684     40.46    202580   3570116  42605940  25420420     37.37         0
06:50:01 PM  39200236  26791636     40.60    206812   3622196  42605940  25420420     37.37         0
07:00:01 PM  39382548  26609324     40.32    208804   3661100  42605940  25420420     37.37         0
07:10:01 PM  39209884  26781988     40.58    211940   3746460  42605940  25420420     37.37         0
07:20:01 PM  39080412  26911460     40.78    215128   3785572  42605940  25420420     37.37         0
07:30:01 PM  39097160  26894712     40.75    216760   3825096  42605940  25420420     37.37         0
07:40:01 PM  38982708  27009164     40.93    218364   3860988  42605940  25420420     37.37         0
07:50:01 PM  38970000  27021872     40.95    220144   3899924  42605940  25420420     37.37         0
Average:     17866377  48125495     72.93   1949824  22634065  42605940  25420420     37.37         0


Will try the ulimit stuffs and post the updates.

Thanks.
 

10 More Discussions You Might Find Interesting

1. Solaris

sendto failing "resource temporarily unavailable"

Well, I am not even sure if its failing, cause at the other end I have a select call and it wakes up and reads the data I sent fine. Ok here is the issue, I have a UDP socket(non blocking) through which I push some data to another port. At the other end I have select loop, waiting for this data.... (6 Replies)
Discussion started by: Naanu
6 Replies

2. Solaris

fork: Resource temporarily unavailable - What can I check ?

Hi everybody, I have an Unix box running Solaris and every day for 1 hour or 2 the box is stuck and I can only get this error message when trying to type a command : bash-3.00$ vmstat 5 bash: fork: Resource temporarily unavailable How can I trace what's is going wrong with this box ?... (5 Replies)
Discussion started by: unclefab
5 Replies

3. UNIX for Advanced & Expert Users

Fork:resource unavailable

Hello. I have code which create processes with fork(). I set a limit for processes by typing ulimit -u 20. Then I run my code who should create 100 processes. Unfortunately, I have a mistake there and I forgot to quit all of my forked processes when fork gave me return value -1. So I am trapped in... (5 Replies)
Discussion started by: samos
5 Replies

4. Solaris

Mmap with fork : Resource unavaialable temporarily

installed 64bit 16GB VM on 64bit ESX server. Written small C code to map the 2GB of memory by mmap after creating 3 child and map getting failed by throwing "resource unavailable temporarily" after mapping 1.6 GB of memory out of 2GB. But same 1.5Gb memory mapping works fine. I checked... (0 Replies)
Discussion started by: siddharoodh
0 Replies

5. UNIX for Dummies Questions & Answers

Resource temporarily unavailable Error In Socket

Hi, Now I am programming to communicate with some network printer through TCP Socket program.By sending command "\033E 1\r" to printer,causes, check the port for error normally. In my case i used following code bytesSent = send( sockfd, "\033E 1\r",sizeof("\033E 1\r"), 0); ... (1 Reply)
Discussion started by: kavinsivakumar
1 Replies

6. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

7. UNIX for Advanced & Expert Users

fork: Resource temporarily unavailable , server unexpectedly unavailable network connection

Solaris 10 Server refuse to connect :wall: fork: Resource temporarily unavailable , server unexpectedly unavailable network connection , refuse error, disconnect message, fatal error type2, (protocol error type2) Issue has been resolved after taken few steps :b: First of all need to check... (1 Reply)
Discussion started by: taherahmed
1 Replies

8. UNIX for Dummies Questions & Answers

Fork: Resource Temporarily Unavailable

I wrote a script that works most of the time but gave me fork: resource temporarily unavailable some of the time. I restarted my computer and now it runs fine but googling "fork: resource temporarily unavailable" and looking on the forums has not actually helped me figure out what exactly I... (3 Replies)
Discussion started by: monstrousturtle
3 Replies

9. Programming

[ERROR:Resource temporarily unavailable!] Serial writing by termios library

Hello, I am using the termios library to write data that I get from a Bluetooth device to a modem via serial. The data arrive from the Bluetooth device correctly every 50ms and I have to bypass them on the serial ttyUSB3 where it is connected to a modem connected to a socket with static IP. The... (10 Replies)
Discussion started by: enaud
10 Replies

10. UNIX for Dummies Questions & Answers

Fork resource unavailable error, max # filehandles open?

I wrote a perl program that simultaneously reads in data from 691 tar.gz files using zcat. I can run one instance of the program without any issues and the memory and swap sizes are negligible. However, when I attempt to run more than 1 I start to get fork: resource unavailable messages. Are... (6 Replies)
Discussion started by: aquinom85
6 Replies
SAR(1)								Linux User's Manual							    SAR(1)

NAME
sar - Collect, report, or save system activity information. SYNOPSIS
sar [ -A ] [ -b ] [ -B ] [ -c ] [ -d ] [ -H ] [ -h ] [ -i interval ] [ -q ] [ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ] [ -n { DEV | EDEV | SOCK | FULL } ] [ -x { pid | SELF | SUM | ALL } ] [ -X { pid | SELF | ALL } ] [ -I { irq | SUM | PROC | ALL | XALL } ] [ -U { cpu | ALL } ] [ -o [ filename ] | -f [ filename ] ] [ -s [ hh:mm:ss ] ] [ -e [ hh:mm:ss ] ] [ interval [ count ] ] DESCRIPTION
The sar command writes to standard output the contents of selected cumulative activity counters in the operating system. The accounting system, based on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds. If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. The default value for the count parameter is 1. If its value is set to zero, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sa/sadd file, where the dd parameter indicates the current day. The sar command extracts and writes to standard output records previously saved in a file. This file can be either the one specified by the -f flag or, by default, the standard system activity daily data file. You can select information about specific system activities using flags. Not specifying any flags selects only CPU activity. Specifying the -A flag is equivalent to specifying -bBcdqrRuvwWy -I SUM -I PROC -n FULL -U ALL. The default version of the sar command (CPU utilization report) might be one of the first facilities the user runs to begin system activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sam- pled is CPU-bound. If multiple samples and multiple reports are desired, it is convenient to specify an output file for the sar command. Run the sar command as a background process. The syntax for this is: sar -o data.file interval count >/dev/null 2>&1 & All data is captured in binary form and saved to a file (data.file). The data can then be selectively displayed with the sar command using the -f option. Set the count parameter to select records at count second intervals. If this parameter is not set, all the records saved in the file will be selected. Collection of data in this manner is useful to characterize system usage over a period of time and determine peak usage hours. Note: The sar command only reports on local activities. OPTIONS
-A This is equivalent to specifying -bBcdqrRuvwWy -I SUM -I PROC -n FULL -U ALL. -b Report I/O and transfer rate statistics. The following values are displayed: tps Total number of transfers per second that were issued to the physical disk. A transfer is an I/O request to the physical disk. Multiple logical requests can be combined into a single I/O request to the disk. A transfer is of indeterminate size. rtps Total number of read requests per second issued to the physical disk. wtps Total number of write requests per second issued to the physical disk. bread/s Total amount of data read from the drive in blocks per second. Blocks are equivalent to sectors with post 2.4 kernels and therefore have a size of 512 bytes. With older kernels, a block is of indeterminate size. bwrtn/s Total amount of data written to the drive in blocks per second. -B Report paging statistics. The following values are displayed: pgpgin/s Total number of blocks the system paged in from disk per second. pgpgout/s Total number of blocks the system paged out to disk per second. activepg Number of active (recently touched) pages in memory. Note that a page has a size of 4 kB or 8 kB according to the machine architecture. inadtypg Number of inactive dirty (modified or potentially modified) pages in memory. inaclnpg Number of inactive clean (not modified) pages in memory. inatarpg "Inactive target" number of pages. This field is a 1-minute floating average of the number of pages the system needs to "steal" every second in order to satisfy memory demand. -c Report process creation activity. proc/s Total number of processes created per second. -d Report activity for each block device (kernels 2.4 and later only). When data is displayed, the device specification dev m-n is gen- erally used ( DEV column). m is the major number of the device, whereas n is a distinctive number. tps Indicate the number of transfers per second that were issued to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size. sect/s Number of sectors transferred from or to the device. The size of a sector is 512 bytes. -e hh:mm:ss Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format. This option can be used only when data are read from or written to a file (options -f or -o ). -f filename Extract records from filename (created by the -o filename flag). The default value of the filename parameter is the current daily data file, the /var/log/sa/sadd file. The -f option is exclusive of the -o option. -h When reading data from a file, print its contents in a format that can easily be handled by pattern processing commands like awk. The output consists of fields separated by a tab. Each record contains the hostname of the host where sar was run, the interval value (or -1 if not applicable), the timestamp (UTC value - Coordinated Universal Time) in seconds from the epoch, the device name (or - if not applicable), the field name and its value. -H When reading data from a file, print its contents in a format that can easily be ingested by a relational database system. The out- put consists of fields separated by a semicolon. Each record contains the hostname of the host where sar was run, the interval value (or -1 if not applicable), the sar timestamp in a form easily acceptable by most databases, and additional semicolon separated data fields as specified by other sar command line options. Note that the timestamp is displayed in UTC (Coordinated Universal Time) unless option -t is used. In this latter case, the timestamp is displayed in local time. -i interval Select data records at seconds as close as possible to the number specified by the interval parameter. -I irq | SUM | PROC | ALL | XALL Report statistics for a given interrupt. irq is the interrupt number. The SUM keyword indicates that the total number of interrupts received per second is to be displayed. The ALL keyword indicates that statistics from the first 16 interrupts are to be reported, whereas the XALL keyword indicates that statistics from all interrupts, including potential APIC interrupt sources, are to be reported. Last, if you use the PROC keyword, the number of interrupts per second received by each processor is displayed. -n DEV | EDEV | SOCK | FULL Report network statistics. With the DEV keyword, statistics from the network devices are reported. The following values are displayed: IFACE Name of the network interface for which statistics are reported. rxpck/s Total number of packets received per second. txpck/s Total number of packets transmitted per second. rxbyt/s Total number of bytes received per second. txbyt/s Total number of bytes transmitted per second. rxcmp/s Number of compressed packets received per second (for cslip etc.). txcmp/s Number of compressed packets transmitted per second. rxmcst/s Number of multicast packets received per second. With the EDEV keyword, statistics on failures (errors) from the network devices are reported. The following values are displayed: IFACE Name of the network interface for which statistics are reported. rxerr/s Total number of bad packets received per second. txerr/s Total number of errors that happened per second while transmitting packets. coll/s Number of collisions that happened per second while transmitting packets. rxdrop/s Number of received packets dropped per second because of a lack of space in linux buffers. txdrop/s Number of transmitted packets dropped per second because of a lack of space in linux buffers. txcarr/s Number of carrier-errors that happened per second while transmitting packets. rxfram/s Number of frame alignment errors that happened per second on received packets. rxfifo/s Number of FIFO overrun errors that happened per second on received packets. txfifo/s Number of FIFO overrun errors that happened per second on transmitted packets. With the SOCK keyword, statistics on sockets in use are reported. The following values are displayed: totsck Total number of used sockets. tcpsck Number of TCP sockets currently in use. udpsck Number of UDP sockets currently in use. rawsck Number of RAW sockets currently in use. ip-frag Number of IP fragments currently in use. The FULL keyword is equivalent to specifying all the keywords above and therefore all the network activities are reported. -o filename Save the readings in the file in binary form. Each reading is in a separate record. The default value of the filename parameter is the current daily data file, the /var/log/sa/sadd file. The -o option is exclusive of the -f option. -q Report queue length and load averages. The following values are displayed: runq-sz Run queue length (number of processes waiting for run time). plist-sz Number of processes in the process list. ldavg-1 System load average for the last minute. ldavg-5 System load average for the past 5 minutes. -r Report memory and swap space utilization statistics. The following values are displayed: kbmemfree Amount of free memory available in kilobytes. kbmemused Amount of used memory in kilobytes. This does not take into account memory used by the kernel itself. %memused Percentage of used memory. kbmemshrd Amount of memory shared by the system in kilobytes. Always zero with 2.4 kernels. kbbuffers Amount of memory used as buffers by the kernel in kilobytes. kbcached Amount of memory used to cache data by the kernel in kilobytes. kbswpfree Amount of free swap space in kilobytes. kbswpused Amount of used swap space in kilobytes. %swpused Percentage of used swap space. -R Report memory statistics. The following values are displayed: frmpg/s Number of memory pages freed by the system per second. A negative value represents a number of pages allocated by the sys- tem. Note that a page has a size of 4 kB or 8 kB according to the machine architecture. shmpg/s Number of additionnal memory pages shared by the system per second. A negative value means fewer pages shared by the system. bufpg/s Number of additionnal memory pages used as buffers by the system per second. A negative value means fewer pages used as buf- fers by the system. campg/s Number of additionnal memory pages cached by the system per second. A negative value means fewer pages in the cache. -s hh:mm:ss Set the starting time of the data, causing the sar command to extract records time-tagged at, or following, the time specified. The default starting time is 08:00. Hours must be given in 24-hour format. This option can be used only when data are read from a file (option -f ). -t When reading data from a daily data file, indicate that sar should display the timestamps in the original locale time of the data file creator. Without this option, the sar command displays the timestamps in the user locale time. When this option is used together with option -H, the timestamp is displayed in local time instead of UTC (Coordinated Universal Time). This option is ignored when option -h is used. -u Report CPU utilization. The following values are displayed: %user Percentage of CPU utilization that occurred while executing at the user level (application). %nice Percentage of CPU utilization that occurred while executing at the user level with nice priority. %system Percentage of CPU utilization that occurred while executing at the system level (kernel). %idle Percentage of time that the CPU or CPUs were idle. -U cpu | ALL Report CPU utilization for a given processor. cpu is the processor number. The ALL keyword indicates that statistics are to be reported for all processors. Note that processor 0 is the first processor. -v Report status of inode, file and other kernel tables. The following values are displayed: dentunusd Number of unused cache entries in the directory cache. file-sz Number of used file handles. %file-sz Percentage of used file handles with regard to the maximum number of file handles that the Linux kernel can allocate. inode-sz Number of used inode handlers. super-sz Number of super block handlers allocated by the kernel. %super-sz Percentage of allocated super block handlers with regard to the maximum number of super block handlers that Linux can allo- cate. dquot-sz Number of allocated disk quota entries. %dquot-sz Percentage of allocated disk quota entries with regard to the maximum number of cached disk quota entries that can be allo- cated. rtsig-sz Number of queued RT signals. %rtsig-sz Percentage of queued RT signals with regard to the maximum number of RT signals that can be queued. -V Print version number and usage then exit. -w Report system switching activity. cswch/s Total number of context switches per second. -W Report swapping statistics. The following values are displayed: pswpin/s Total number of swap pages the system brought in per second. pswpout/s Total number of swap pages the system brought out per second. -x pid | SELF | SUM | ALL Report statistics for a given process. pid is the process identification number. The SELF keyword indicates that statistics are to be reported for the sar process itself, whereas the ALL keyword indicates that statistics are to be reported for all the system pro- cesses. When the SUM keyword is used, the total number of minor and major faults made by the system is reported. All these statis- tics cannot be saved to a file. So this option will be ignored whenever -o option is used. At the present time, no more than 256 processes can be monitored simultaneously. When the SUM keyword is not used, the following values are displayed: minflt/s Total number of minor faults the process has made per second, those which have not required loading a memory page from disk. majflt/s Total number of major faults the process has made per second, those which have required loading a memory page from disk. %user Percentage of CPU used by the process while executing at the user level (application). %system Percentage of CPU used by the process while executing at the system level (kernel). nswap/s Number of pages from the process address space the system has swapped out per second. CPU Processor number to which the process is attached. When the SUM keyword is used on the command line, the following values are displayed: minflt/s Total number of minor faults the system has made per second, those which have not required loading a memory page from disk. majflt/s Total number of major faults the system has made per second, those which have required loading a memory page from disk. These last two statistics are consistent only when no processes have terminated. If a process is killed during the interval, the statistics are not available (marked as ????) and the average number will not be computed. -X pid | SELF | ALL Report statistics for the child processes of the process whose PID is pid . The SELF keyword indicates that statistics are to be reported for the child processes of the sar process itself, whereas the ALL keyword indicates that statistics are to be reported for all the child processes of all the system processes. All these statistics cannot be saved to a file. So this option will be ignored whenever -o option is used. At the present time, no more than 256 processes can be monitored simultaneously. The following values are displayed: cminflt/s Total number of minor faults the child processes have made per second, those which have not required loading a memory page from disk. cmajflt/s Total number of major faults the child processes have made per second, those which have required loading a memory page from disk. %cuser Percentage of CPU used by the child processes while executing at the user level (application). %csystem Percentage of CPU used by the child processes while executing at the system level (kernel). cnswap/s Number of pages from the child process address spaces the system has swapped out per second. -y Report TTY device activity. The following values are displayed: rcvin/s Number of receive interrupts per second for current serial line. Serial line number is given in the TTY column. xmtin/s Number of transmit interrupts per second for current serial line. ENVIRONMENT
The sar command takes into account the following environment variable: S_TIME_FORMAT If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The sar command will use the ISO format (YYYY-MM-DD) instead. EXAMPLES
sar -u 2 5 Report CPU utilization for each 2 seconds. 5 lines are displayed. sar -I 14 -o int14.file 2 10 Report statistics on IRQ 14 for each 2 seconds. 10 lines are displayed. Data are stored in a file called int14.file. sar -r -n DEV -f /var/log/sa/sa16 Display memory, swap space and network statistics saved in daily data file 'sa16'. sar -A Display all the statistics saved in current daily data file. BUGS
/proc filesystem must be mounted for the sar command to work. All the statistics are not necessarily available, depending on the kernel version used. In particular, TTY statistics (option -y) are not available in 2.2.x SMP kernels (with x <= 15), because of an SMP race that sar may trigger when reading the /proc/tty/driver/serial file. FILES
/var/log/sa/sadd Indicate the daily data file, where the dd parameter is a number representing the day of the month. /proc contains various files with system statistics. AUTHOR
Sebastien Godard <sebastien.godard@wanadoo.fr> SEE ALSO
sadc(8), sa1(8), sa2(8), isag(1), mpstat(1), iostat(1), vmstat(8) http://perso.wanadoo.fr/sebastien.godard/ Linux OCTOBER 2001 SAR(1)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy