linux - much higher cpu usage for usleep on Debian 8 than on Debian 6 -


a performance issue encountered our software system after upgraded os debian 6 debian 8.

from top -h results, looks threads using usleep(200) in system have major cpu usage increasing, tested listed sample program:

#include <unistd.h>  int main(int argc, char **argv) {     while (true)         usleep(200);     return 0; } 

on intel i3 system (no gui os enabled, command line), program cause 1% cpu usage on debian 6 while 2.3% on debian 8.

we've checked suspicious kernel configuration , no useful clue have been found. also, both os have enabled high resolution timer.

debian 8.2 (3.16.0-4):

config_rcu_fast_no_hz=y config_hz=250 config_hpet_timer=y config_hpet_emulate_rtc=y config_hpet=y config_hpet_mmap=y config_hpet_mmap_default=y config_high_res_timers=y 

debian 6 (2.6.32-5):

config_no_hz=y config_hz=250 config_hpet_timer=y config_hpet_emulate_rtc=y config_hpet=y config_hpet_mmap=y config_high_res_timers=y 

we know sub-millisecond sleep cause kind of cpu usage while didn't expect quite different cpu usage on different os versions.

any suggestion appreciated.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -