puppettop? How can I see what puppet is doing? - monitoring

I'm getting started with Puppet. I added some lines to a manifest and when running Puppet now it's been at 100% cpu for a very longtime. Is there a good way to see what puppet is actually doing? puppettop?
top gives me this, which is quite useless:
top - 20:02:11 up 1 day, 2:30, 5 users, load average: 1.02, 1.12, 0.93
Tasks: 164 total, 2 running, 162 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.5%us, 0.0%sy, 0.0%ni, 87.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32809072k total, 10412396k used, 22396676k free, 243832k buffers
Swap: 16768892k total, 0k used, 16768892k free, 6978500k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9761 root 20 0 646m 558m 3568 R 100 1.7 20:42.88 puppet
10509 guaka 20 0 17344 1352 972 R 0 0.0 0:00.28 top
1 root 20 0 24216 2192 1344 S 0 0.0 0:00.85 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0 0.0 0:02.83 ksoftirqd/0
4 root 20 0 0 0 0 S 0 0.0 0:00.00 kworker/0:0
5 root 0 -20 0 0 0 S 0 0.0 0:00.00 kworker/0:0H

Related

Find specific value in file using lua

i have file with below format :-
** Resuming transfer from byte position 13247324
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:10 --:--:-- 0
0 9539k 0 0 0 0 0 0 --:--:-- 0:00:11 --:--:-- 0
0 9539k 0 0 0 0 0 0 --:--:-- 0:00:12 --:--:-- 0
0 9539k 0 8192 0 0 598 0 4:32:14 0:00:13 4:32:01 1882
0 9539k 0 13238 0 0 865 0 3:08:12 0:00:15 3:07:57 2459
39k 11 1109k 0 0 12684 0 0:12:50 0:01:29 0:11:21 22753
11 9539k 11 1117k 0 0 12570 0 0:12:57 0:01:31 0:11:26 15004
11 9539k 11 1117k 0 0 12433 0 0:13:05 0:01:32 0:11:33 11847
11 9539k 11 1117k 0 0 12299 0 0:13:14 0:01:33 0:11:41 9191
11 9539k 11 1117k 0 0 12168 0 0:13:22 0:01:34 0:11:48 6011
11 9539k 11 1124k 0 0 12122 0 0:13:25 0:01:35 0:11:50 2844
12 9539k 12 1173k 0 0 12566 0 0:12:57 0:01:35 0:11:22 12479
12 9539k 12 1173k 0 0 12384 0 0:13:08 0:01:37 0:11:31 11475
12 9539k 12 1173k 0 0 12257 0 0:13:16 0:01:38 0:11:38 11473
12 9539k 12 1197k 0 0 12371 0 0:13:09 0:01:39 0:11:30 16129
I want to find only the average dload values
My current code is :-
local file = io.open(path, "rb")
if not file then return nil end
local lines = {}
local words = {}
for line in io.lines(path) do
for word in line:gmatch("%w+") do
table.insert(words, word)
end
table.insert(lines, words)
end
file:close()
return words;
But this code is giving me indexes , and all words as values. I am not able to find specific value for average dload
I am new to lua , any help is much appreciated
I think you are almost there. This is how I would do that. col will hold the number of the column for which we are gathering the output, such that you can separately get the stats for the different columns.
local file = io.open(path, "rb")
if not file then return nil end
local lines = {}
local stats = {}
local col
for line in io.lines(path) do
col = 0
for word in line:gmatch("%w+") do
if word then
col = col + 1
stats[col] = stats[col] or { }
stats[col][word] = (stats[col][word] or 0) + 1
end
end
table.insert(lines, words)
end
file:close()
When I do now the following:
for col, val in ipairs(stats) do
for word, count in pairs(val) do
print("Col=", col, "word=", word, "count=",count)
end
end
I get the following output:
Col= 1 word= 39k count= 1
Col= 1 word= 0 count= 13
Col= 1 word= 11 count= 5
Col= 1 word= 12 count= 4
Col= 2 word= 0 count= 9
Col= 2 word= 9539k count= 13
Col= 2 word= 11 count= 1
Col= 3 word= 12 count= 4
...etc.

What does the "*A" and "*U" means in the "sctp assocs" display?

cat /proc/net/sctp/assocs
ASSOC-ID ASSOC SOCK STY SST ST HBKT TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS HBINT INS OUTS MAXRT T1X T2X RTXC wmema wmemq sndbuf rcvbuf
13 ffff8800b93a9000 ffff8800ac752300 2 1 3 9176 0 0 0 20735 3905 48538 *192.168.44.228 <-> *A172.16.236.92 7500 10 10 2 0 0 23 1 0 2000000 2000000
0 ffff88042aea3000 ffff880422e88000 0 10 1 40840 0 0 0 9542 3868 3868 *10.127.58.66 <-> *U10.127.115.194 7500 17 17 10 0 0 0 1 0 8388608 8388608

Jenkins process high cpu usage 800%.

I have installed jenkins version 1.614 on ubuntu 12.04 with configuration - 32 GB ram, 2 TB hdd and 8 CPU cores. Currently Jenkins has 594 jobs added.
In normal condition when no job is running cpu usage is 0% but When I start any job build cpu usage suddenly reaches 700-800%.
Following are the stats for cpu usage.
top - 06:29:55 up 160 days, 17:43, 3 users, load average: 4.27, 2.54, 2.43
Tasks: 123 total, 2 running, 118 sleeping, 0 stopped, 3 zombie
Cpu0 : 96.7%us, 0.3%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 95.7%us, 1.0%sy, 0.0%ni, 3.0%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 96.7%us, 0.7%sy, 0.0%ni, 2.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 92.0%us, 0.7%sy, 0.0%ni, 7.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 96.7%us, 0.3%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 96.7%us, 0.7%sy, 0.0%ni, 2.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 97.0%us, 0.0%sy, 0.0%ni, 3.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32809732k total, 26551884k used, 6257848k free, 481144k buffers
Swap: 16768892k total, 8376k used, 16760516k free, 15064772k cached
3852 jenkins 20 0 12.5g 8.1g 21m S 774 26.0 2095:06 java
14 root 20 0 0 0 0 S 0 0.0 5:05.81 kworker/2:0
67 root 20 0 0 0 0 S 0 0.0 4:51.63 kworker/3:1
399 root 20 0 0 0 0 S 0 0.0 4:12.45 jbd2/md2-8
1251 root 20 0 0 0 0 S 0 0.0 6:02.19 flush-9:2
6754 appster 20 0 1052m 152m 2244 S 0 0.5 317:39.39 statsd
1 root 20 0 24196 1528 832 S 0 0.0 0:18.22 init
I have also deleted job builds older than 30 days and current running job build is also small job, Still cpu usage is very high.

Example of Recording from the Mic and processing the (PCM?) file

I need to record sounds from the iPhone mic and process the samples in my Swift app. I would really appreciate an example to follow.
These Recording settings
let recordSettings:[String : AnyObject] = [
AVFormatIDKey: NSNumber(unsignedInt:kAudioFormatLinearPCM),
//AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue,
// AVEncoderBitRateKey : 320000,
AVNumberOfChannelsKey: 1,
AVSampleRateKey : 8000.0,
AVLinearPCMBitDepthKey: 16,
AVLinearPCMIsBigEndianKey: "true",
AVLinearPCMIsFloatKey: "false"
]
produce the following bytes
99 97 102 102 0 1 0 0 100 101 115 99 0 0 0 0 0 0 0 32 64 191 64 0 0 0 0 0 108 112 99 109 0 0 0 2 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0 16 102 114 101 101 0 0 0 0 0 0 15 176 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Which looks fishy maybe it's a double still?
I already created an example for something like that. It gets the data from the microphone, does a Fast-Fourier-Transform on it to find the frequencies and displays them in the view. It's done for OSX, but it should also work on iOS:
https://github.com/Kametrixom/Frequencies

Erlang application exit,, but vm is still running

My Erlang applicaation processed crashed and then exited, but found that the erlang VM is still running.
I could recieve pong when ping this "suspended node"
Types regs() and the results show below, there is not my app process.
(hub#192.168.1.140)4> regs().
** Registered procs on node 'hub#192.168.1.140' **
Name Pid Initial Call Reds Msgs
application_controlle <0.7.0> erlang:apply/2 30258442 1390
auth <0.20.0> auth:init/1 189 0
code_server <0.26.0> erlang:apply/2 1194028 0
erl_epmd <0.19.0> erl_epmd:init/1 138 0
erl_prim_loader <0.3.0> erlang:apply/2 2914236 0
error_logger <0.6.0> gen_event:init_it/6 49983527 0
file_server_2 <0.25.0> file_server:init/1 16185407 0
global_group <0.24.0> global_group:init/1 107 0
global_name_server <0.13.0> global:init/1 1385 0
gr_counter_sup <0.43.0> supervisor:gr_counter_sup 253 0
gr_lager_default_trac <0.70.0> gr_counter:init/1 121 0
gr_lager_default_trac <0.72.0> gr_manager:init/1 46 0
gr_lager_default_trac <0.69.0> gr_param:init/1 117 0
gr_lager_default_trac <0.71.0> gr_manager:init/1 46 0
gr_manager_sup <0.45.0> supervisor:gr_manager_sup 484 0
gr_param_sup <0.44.0> supervisor:gr_param_sup/1 253 0
gr_sup <0.42.0> supervisor:gr_sup/1 237 0
inet_db <0.16.0> inet_db:init/1 749 0
inet_gethost_native <0.176.0> inet_gethost_native:serve 4698517 0
inet_gethost_native_s <0.175.0> supervisor_bridge:inet_ge 41 0
init <0.0.0> otp_ring0:start/2 30799457 0
kernel_safe_sup <0.35.0> supervisor:kernel/1 278 0
kernel_sup <0.11.0> supervisor:kernel/1 47618 0
lager_crash_log <0.52.0> lager_crash_log:init/1 97712230 0
lager_event <0.50.0> gen_event:init_it/6 1813660437 0
lager_handler_watcher <0.51.0> supervisor:lager_handler_ 358 0
lager_sup <0.49.0> supervisor:lager_sup/1 327 0
net_kernel <0.21.0> net_kernel:init/1 110769667 0
net_sup <0.18.0> supervisor:erl_distributi 313 0
os_cmd_port_creator <0.582.0> erlang:apply/2 81 0
rex <0.12.0> rpc:init/1 15653480 0
standard_error <0.28.0> erlang:apply/2 9 0
standard_error_sup <0.27.0> supervisor_bridge:standar 41 0
timer_server <0.100.0> timer:init/1 59356077 0
user <0.31.0> group:server/3 23837008 0
user_drv <0.30.0> user_drv:server/2 12239455 0
** Registered ports on node 'hub#192.168.1.140' **
Name Id Command
ok
It rarely occurs, but anyone explains it?
System: CentOS 5.8
Erlang: R15B03

Resources