Sponsored Content
Full Discussion: Hack CPU Utilization
Top Forums UNIX for Dummies Questions & Answers Hack CPU Utilization Post 302371697 by matrixmadhan on Monday 16th of November 2009 05:09:43 AM
Old 11-16-2009
Quote:
The function should be terminated by a signal. Is this feasible
Executing function is not visible to the kernel but the process in which its wrapped is available to the external world for communication. I guess this is what you meant right?

Keeping pinging for the load average often if it exceeds or equals commit suicide or restart

Code:
sub get_system_load {
    open(L, '<', '/proc/loadavg') or die "Unable to open /proc/loadavg file <$!>\n";
    my $data = <L>;
    close(L);

    return (split(' ', $data))[0];
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CPU Utilization

What command do you use to verify if the CPU utilization. Example. If the CPU is at 98%? Thanks (4 Replies)
Discussion started by: kimosilk
4 Replies

2. UNIX for Advanced & Expert Users

CPU Utilization

On user complains about the performance of web application, as a part application support, we use following commands to see the CPU utilization in the UNIX using ‘sar' command. Some times it goes below 20 and even reaches 0. HLW$~> sar -u 10 60 SunOS HLW 5.8 Generic_117350-14 sun4u ... (2 Replies)
Discussion started by: thinakarmani
2 Replies

3. UNIX for Dummies Questions & Answers

% CPU utilization

Hi, iam new to AIX and had a basic question. I was asked to give a chart of CPU utilization in percentage for every hour. where can i look for information and which column should i look at? I would be very thankful if somebody could respond. Thanks! karthik (1 Reply)
Discussion started by: karthikosu
1 Replies

4. Shell Programming and Scripting

CPU Utilization

Dear friends, I am doing a report daily for all most 30 more serves... i need to check out CPU utlization bu (top command, 100 - (ideal value)) and Memory utilization too could some one help me how can i get it directly, if scripts also no problem.. i will very thankful if some one... (3 Replies)
Discussion started by: bullz26
3 Replies

5. Shell Programming and Scripting

CPU Utilization

Hi to All, Would you please help me. I would like to know, In Unix How to know CPU utilization for every process. Thanks in Advance. Thanks, Divyang (3 Replies)
Discussion started by: div_Neev
3 Replies

6. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

7. AIX

CPU Utilization

Hi All, Can some one help me in finding % CPU Utilization ? From VMSTAT command, How we can find % utilization ? Thanks (3 Replies)
Discussion started by: VBudatha
3 Replies

8. Shell Programming and Scripting

CPU Utilization

I know how to check the CPU utilization and memory space like: vmstat top free What i want ot check on my linux system is... how much CPU are available on my system and do i need to put extra CPU. Also need to check the hardware configuration and the space related to the same ... (3 Replies)
Discussion started by: j_panky
3 Replies

9. UNIX for Advanced & Expert Users

CPU utilization

Hi, any commande on AIX 6.1 that shows me total CPU utilization ? I saw curt in documentation but there should be a trace file before. Thank you. (1 Reply)
Discussion started by: big123456
1 Replies

10. Red Hat

CPU Utilization and Memory Utilization of Services and Applications

Hi, i am new to linux/RHEL 6.0 and i have two questions. 1) How to get the CPU utilization and Memory Utilization of all Services running currently? 2) How to get the CPU utilization and Memory Utilization of all Applications running currently? Please help me to find the script. ... (2 Replies)
Discussion started by: nossam
2 Replies
KILL(2) 						     Linux Programmer's Manual							   KILL(2)

NAME
kill - send signal to a process SYNOPSIS
#include <sys/types.h> #include <signal.h> int kill(pid_t pid, int sig); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): kill(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE DESCRIPTION
The kill() system call can be used to send any signal to any process group or process. If pid is positive, then signal sig is sent to the process with the ID specified by pid. If pid equals 0, then sig is sent to every process in the process group of the calling process. If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), but see below. If pid is less than -1, then sig is sent to every process in the process group whose ID is -pid. If sig is 0, then no signal is sent, but error checking is still performed; this can be used to check for the existence of a process ID or process group ID. For a process to have permission to send a signal it must either be privileged (under Linux: have the CAP_KILL capability), or the real or effective user ID of the sending process must equal the real or saved set-user-ID of the target process. In the case of SIGCONT it suf- fices when the sending and receiving processes belong to the same session. RETURN VALUE
On success (at least one signal was sent), zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EINVAL An invalid signal was specified. EPERM The process does not have permission to send the signal to any of the target processes. ESRCH The pid or process group does not exist. Note that an existing process might be a zombie, a process which already committed termi- nation, but has not yet been wait(2)ed for. CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001. NOTES
The only signals that can be sent to process ID 1, the init process, are those for which init has explicitly installed signal handlers. This is done to assure the system is not brought down accidentally. POSIX.1-2001 requires that kill(-1,sig) send sig to all processes that the calling process may send signals to, except possibly for some implementation-defined system processes. Linux allows a process to signal itself, but on Linux the call kill(-1,sig) does not signal the calling process. POSIX.1-2001 requires that if a process sends a signal to itself, and the sending thread does not have the signal blocked, and no other thread has it unblocked or is waiting for it in sigwait(3), at least one unblocked signal must be delivered to the sending thread before the kill() returns. Linux Notes Across different kernel versions, Linux has enforced different rules for the permissions required for an unprivileged process to send a signal to another process. In kernels 1.0 to 1.2.2, a signal could be sent if the effective user ID of the sender matched that of the receiver, or the real user ID of the sender matched that of the receiver. From kernel 1.2.3 until 1.3.77, a signal could be sent if the effective user ID of the sender matched either the real or effective user ID of the receiver. The current rules, which conform to POSIX.1-2001, were adopted in kernel 1.3.78. BUGS
In 2.6 kernels up to and including 2.6.7, there was a bug that meant that when sending signals to a process group, kill() failed with the error EPERM if the caller did have permission to send the signal to any (rather than all) of the members of the process group. Notwith- standing this error return, the signal was still delivered to all of the processes for which the caller had permission to signal. SEE ALSO
_exit(2), killpg(2), signal(2), sigqueue(2), tkill(2), exit(3), capabilities(7), credentials(7), signal(7) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2009-09-15 KILL(2)
All times are GMT -4. The time now is 07:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy