Пятница, 4 января 2013, 18:20 -03:00 от Claudio Freire <klaussfreire@xxxxxxxxx>:
Not pinned.On Fri, Jan 4, 2013 at 6:07 PM, nobody nowhere <devnull@xxxxxxx> wrote:
> 9092 postgres 16 0 4326m 41m 34m S 0.0 0.3 0:00.27 14 postgres: user user_db [local] idle
> 9098 postgres 16 0 4329m 203m 194m S 3.5 1.3 0:00.65 14 postgres: user user_db [local] idle
> 9099 postgres 16 0 4327m 45m 38m S 0.0 0.3 0:00.41 14 postgres: user user_db [local] idle
That looks like pg has been pinned to CPU14. I don't think it's pg's
doing. All I can think of is: check scheduler tweaks, numa, and pg's
initscript. Just in case it's being pinned explicitly.
Forks with tcp connection use other CPU. I just add connections pool and change socket to tcp
#top -d 10.00 -b -n 2 -U postgres
top - 22:29:00 up 454 days, 8 min, 1 user, load average: 0.39, 0.51, 0.46
Tasks: 429 total, 1 running, 428 sleeping, 0 stopped, 0 zombie
Cpu0 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.1%us, 0.0%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.9%us, 0.1%sy, 0.0%ni, 98.9%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Cpu4 : 1.9%us, 0.4%sy, 0.0%ni, 97.5%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Cpu5 : 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 2.6%us, 0.1%sy, 0.0%ni, 97.2%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 1.6%us, 0.3%sy, 0.0%ni, 98.0%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Cpu8 : 1.6%us, 0.3%sy, 0.0%ni, 97.9%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Cpu9 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu10 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu11 : 1.1%us, 0.5%sy, 0.0%ni, 98.1%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu12 : 1.0%us, 0.0%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu13 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu14 : 18.7%us, 0.3%sy, 0.0%ni, 80.6%id, 0.3%wa, 0.0%hi, 0.1%si, 0.0%st
Cpu15 : 0.0%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.1%hi, 0.2%si, 0.0%st
Mem: 16426540k total, 16368832k used, 57708k free, 219524k buffers
Swap: 4194232k total, 147312k used, 4046920k free, 14468220k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND
10129 postgres 16 0 4329m 243m 233m S 1.9 1.5 0:04.05 14 postgres: user user_db [local] idle
10198 postgres 16 0 4329m 243m 234m S 1.9 1.5 0:03.49 14 postgres: user user_db [local] idle
10092 postgres 16 0 4330m 238m 228m S 1.7 1.5 0:03.09 14 postgres: user user_db [local] idle
10190 postgres 15 0 4328m 234m 226m S 1.7 1.5 0:02.94 14 postgres: user user_db [local] idle
10169 postgres 16 0 4329m 235m 225m S 1.3 1.5 0:03.22 14 postgres: user user_db [local] idle
10102 postgres 15 0 4328m 237m 227m S 1.2 1.5 0:03.24 14 postgres: user user_db [local] idle
10217 postgres 16 0 4329m 241m 231m S 1.2 1.5 0:04.73 14 postgres: user user_db [local] idle
10094 postgres 15 0 4330m 244m 233m S 0.9 1.5 0:03.67 14 postgres: user user_db [local] idle
10137 postgres 16 0 4331m 238m 227m S 0.8 1.5 0:03.14 14 postgres: user user_db [local] idle
10149 postgres 15 0 4328m 238m 229m S 0.8 1.5 0:03.07 14 postgres: user user_db [local] idle
10161 postgres 16 0 4331m 245m 234m S 0.8 1.5 0:03.91 6 postgres: user user_db [local] idle
10178 postgres 16 0 4330m 245m 234m S 0.8 1.5 0:04.01 14 postgres: user user_db [local] idle
10182 postgres 16 0 4330m 236m 227m S 0.8 1.5 0:02.38 14 postgres: user user_db [local] idle
10189 postgres 15 0 4330m 241m 231m S 0.8 1.5 0:03.07 14 postgres: user user_db [local] idle
10208 postgres 16 0 4329m 237m 227m S 0.8 1.5 0:03.74 14 postgres: user user_db [local] idle
10128 postgres 16 0 4330m 240m 229m S 0.7 1.5 0:03.15 14 postgres: user user_db [local] idle
10142 postgres 16 0 4331m 241m 230m S 0.7 1.5 0:03.23 14 postgres: user user_db [local] idle
10194 postgres 15 0 4328m 236m 227m S 0.7 1.5 0:03.24 14 postgres: user user_db [local] idle
6878 postgres 15 0 4319m 2992 1472 S 0.3 0.0 44:06.10 11 postgres: wal sender process postgres XXX.XXX.XXX.XXX(47880) streaming 21D/D76286B0
10180 postgres 16 0 4329m 240m 231m S 0.3 1.5 0:02.88 4 postgres: user user_db [local] idle
10115 postgres 16 0 4331m 236m 225m S 0.2 1.5 0:03.53 14 postgres: user user_db [local] idle
10162 postgres 16 0 4330m 240m 230m S 0.2 1.5 0:03.01 14 postgres: user user_db [local] idle
10212 postgres 16 0 4329m 238m 228m S 0.2 1.5 0:03.52 14 postgres: user user_db [local] idle
10213 postgres 15 0 4329m 238m 228m S 0.2 1.5 0:02.96 14 postgres: user user_db [local] idle
10100 postgres 16 0 4331m 237m 226m S 0.1 1.5 0:03.39 14 postgres: user user_db [local] idle
10112 postgres 16 0 4331m 240m 229m S 0.1 1.5 0:03.83 14 postgres: user user_db [local] idle
10117 postgres 15 0 4329m 239m 229m S 0.1 1.5 0:04.42 14 postgres: user user_db [local] idle
10121 postgres 16 0 4330m 240m 230m S 0.1 1.5 0:03.08 6 postgres: user user_db [local] idle
10125 postgres 15 0 4329m 243m 233m S 0.1 1.5 0:04.90 14 postgres: user user_db [local] idle
10127 postgres 15 0 4329m 238m 228m S 0.1 1.5 0:02.81 14 postgres: user user_db [local] idle
10135 postgres 15 0 4329m 238m 229m S 0.1 1.5 0:03.20 14 postgres: user user_db [local] idle
10136 postgres 16 0 4329m 237m 227m S 0.1 1.5 0:02.77 14 postgres: user user_db [local] idle
10138 postgres 16 0 4330m 243m 232m S 0.1 1.5 0:03.46 14 postgres: user user_db [local] idle
10139 postgres 15 0 4330m 236m 225m S 0.1 1.5 0:03.14 14 postgres: user user_db [local] idle
10143 postgres 16 0 4330m 246m 236m S 0.1 1.5 0:02.93 14 postgres: user user_db [local] idle
10144 postgres 16 0 4331m 237m 227m S 0.1 1.5 0:02.81 14 postgres: user user_db [local] idle
10148 postgres 15 0 4331m 251m 240m S 0.1 1.6 0:04.07 14 postgres: user user_db [local] idle
10165 postgres 16 0 4331m 246m 235m S 0.1 1.5 0:02.36 14 postgres: user user_db [local] idle
10166 postgres 15 0 4330m 235m 226m S 0.1 1.5 0:02.55 14 postgres: user user_db [local] idle
10168 postgres 15 0 4329m 234m 225m S 0.1 1.5 0:03.26 14 postgres: user user_db [local] idle
10173 postgres 16 0 4329m 236m 226m S 0.1 1.5 0:02.82 6 postgres: user user_db [local] idle
10174 postgres 15 0 4328m 240m 232m S 0.1 1.5 0:03.98 14 postgres: user user_db [local] idle
10184 postgres 16 0 4328m 237m 228m S 0.1 1.5 0:02.85 14 postgres: user user_db [local] idle
10186 postgres 15 0 4329m 239m 229m S 0.1 1.5 0:03.47 14 postgres: user user_db [local] idle
10191 postgres 15 0 4330m 243m 233m S 0.1 1.5 0:03.69 14 postgres: user user_db [local] idle
10195 postgres 16 0 4329m 240m 231m S 0.1 1.5 0:03.02 14 postgres: user user_db [local] idle
10199 postgres 15 0 4331m 234m 222m S 0.1 1.5 0:02.87 14 postgres: user user_db [local] idle
10203 postgres 15 0 4329m 234m 224m S 0.1 1.5 0:04.00 14 postgres: user user_db [local] idle
10207 postgres 16 0 4331m 236m 225m S 0.1 1.5 0:03.52 6 postgres: user user_db [local] idle
10210 postgres 15 0 4330m 237m 227m S 0.1 1.5 0:02.90 14 postgres: user user_db [local] idle
10211 postgres 15 0 4330m 244m 234m S 0.1 1.5 0:03.24 14 postgres: user user_db [local] idle
10225 postgres 16 0 4330m 237m 226m S 0.1 1.5 0:03.55 14 postgres: user user_db [local] idle
10226 postgres 16 0 4330m 235m 224m S 0.1 1.5 0:02.59 14 postgres: user user_db [local] idle
10227 postgres 15 0 4332m 247m 236m S 0.1 1.5 0:03.71 14 postgres: user user_db [local] idle
10229 postgres 16 0 4329m 236m 226m S 0.1 1.5 0:02.38 14 postgres: user user_db [local] idle
7818 postgres 15 0 4319m 6640 4680 S 0.0 0.0 0:00.06 8 postgres: postgres user_db XXX.XXX.XXX.XXX(1032) idle
10097 postgres 16 0 4328m 235m 226m S 0.0 1.5 0:03.25 14 postgres: user user_db [local] idle
10114 postgres 16 0 4331m 245m 234m S 0.0 1.5 0:03.79 14 postgres: user user_db [local] idle
10118 postgres 15 0 4328m 235m 226m S 0.0 1.5 0:03.53 14 postgres: user user_db [local] idle
10152 postgres 15 0 4331m 241m 229m S 0.0 1.5 0:03.55 14 postgres: user user_db [local] idle
10170 postgres 16 0 4330m 240m 229m S 0.0 1.5 0:03.19 14 postgres: user user_db [local] idle
10185 postgres 15 0 4330m 235m 225m S 0.0 1.5 0:03.83 14 postgres: user user_db [local] idle
10187 postgres 16 0 4330m 237m 226m S 0.0 1.5 0:03.34 14 postgres: user user_db [local] idle
10202 postgres 16 0 4330m 234m 224m S 0.0 1.5 0:02.74 14 postgres: user user_db [local] idle
10220 postgres 16 0 4329m 258m 248m S 0.0 1.6 0:03.85 6 postgres: user user_db [local] idle
10223 postgres 16 0 4331m 243m 233m S 0.0 1.5 0:03.85 14 postgres: user user_db [local] idle
14378 postgres 15 0 4320m 7324 4928 S 0.0 0.0 0:00.03 4 postgres: postgres postgres XXX.XXX.XXX.XXX(1030) idle
14979 postgres 15 0 4316m 104m 103m S 0.0 0.6 6:54.61 8 /usr/pgsql-9.1/bin/postmaster -p 5432 -D /var/lib/pgsql/9.1/data
14981 postgres 15 0 112m 1368 728 S 0.0 0.0 0:00.06 12 postgres: logger process
14995 postgres 15 0 4320m 2.0g 2.0g S 0.0 12.7 4:49.23 15 postgres: writer process
14996 postgres 15 0 4318m 17m 16m S 0.0 0.1 0:12.96 15 postgres: wal writer process
14997 postgres 15 0 4319m 3312 1568 S 0.0 0.0 0:10.30 2 postgres: autovacuum launcher process
14998 postgres 15 0 114m 1444 756 S 0.0 0.0 0:13.32 15 postgres: archiver process last was 000000010000021D000000D6
14999 postgres 15 0 115m 1840 808 S 0.0 0.0 30:32.88 1 postgres: stats collector process
15027 postgres 15 0 4319m 80m 78m S 0.0 0.5 32:10.90 11 postgres: monitor user_db XXX.XXX.XXX.XXX(55433) idle
15070 postgres 15 0 4319m 82m 80m S 0.0 0.5 29:12.70 7 postgres: monitor user_db XXX.XXX.XXX.XXX(59360) idle
15808 postgres 16 0 4324m 15m 10m S 0.0 0.1 0:00.27 7 postgres: postgres user_db XXX.XXX.XXX.XXX(1031) idle
19598 postgres 16 0 4320m 7328 4932 S 0.0 0.0 0:00.00 15 postgres: postgres postgres XXX.XXX.XXX.XXX(59745) idle
19599 postgres 15 0 4321m 13m 10m S 0.0 0.1 0:00.10 4 postgres: postgres user_db XXX.XXX.XXX.XXX(59746) idle
19625 postgres 15 0 4320m 8844 6076 S 0.0 0.1 0:00.04 11 postgres: postgres user_db XXX.XXX.XXX.XXX(59768) idle
19633 postgres 15 0 4320m 7112 4880 S 0.0 0.0 0:00.00 11 postgres: postgres postgres XXX.XXX.XXX.XXX(3586) idle
19634 postgres 15 0 4327m 19m 9.9m S 0.0 0.1 0:00.15 11 postgres: postgres user_db XXX.XXX.XXX.XXX(3588) idle
19639 postgres 15 0 4321m 58m 55m S 0.0 0.4 0:00.15 4 postgres: postgres user_db XXX.XXX.XXX.XXX(3612) idle