c - why select leads to high cpu sys load? -


  1. top: cpu load of process 100%, , 90% sys
  2. strace: system calls select
  3. select: select(11, [8, 10], null, null, {0, 10}) = 0 (timeout), fd 8 , fd 10 both fifo
  4. vmstat -n 5: system cs , system in low
  5. linux: 2.6.16.60
  6. cpu: 4 cores, intel(r) xeon(r) cpu e5504 @ 2.00ghz

how explain it? , have changed timeout of select 1s, cpu sys load changed 85%, why?

have changed nfds of select highest fd plus one, still high cpu sys load



edit -- problem solved

bug has nothing select, third argument abstime of pthread_mutex_timedwait absolute time, used relative time mistake, caused high cpu sys load.

and why pthread_mutex_timedwait causes high cpu sys load, not high cpu usr load?
strace: see select system call, no others

you may have bad (disconnected) descriptor. main reason such load on read select.

you may have data available, never read it. same situation.

you might heavy between of select calls.

if select returns 0, problem not in select call. elsewhere.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -