{"action":"closed","issue":{"url":"https://api.github.com/repos/XX-net/XX-Net/issues/376","labels_url":"https://api.github.com/repos/XX-net/XX-Net/issues/376/labels{/name}","comments_url":"https://api.github.com/repos/XX-net/XX-Net/issues/376/comments","events_url":"https://api.github.com/repos/XX-net/XX-Net/issues/376/events","html_url":"https://github.com/XX-net/XX-Net/issues/376","id":74659951,"number":376,"title":"对于CPU 突然高占用问题的数据提供","user":{"login":"cnccn","id":12370939,"avatar_url":"https://avatars.githubusercontent.com/u/12370939?v=3","gravatar_id":"","url":"https://api.github.com/users/cnccn","html_url":"https://github.com/cnccn","followers_url":"https://api.github.com/users/cnccn/followers","following_url":"https://api.github.com/users/cnccn/following{/other_user}","gists_url":"https://api.github.com/users/cnccn/gists{/gist_id}","starred_url":"https://api.github.com/users/cnccn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnccn/subscriptions","organizations_url":"https://api.github.com/users/cnccn/orgs","repos_url":"https://api.github.com/users/cnccn/repos","events_url":"https://api.github.com/users/cnccn/events{/privacy}","received_events_url":"https://api.github.com/users/cnccn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/XX-net/XX-Net/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-09T12:16:15Z","updated_at":"2015-08-05T09:28:56Z","closed_at":"2015-08-05T09:28:56Z","body":"平台：Mac OS X 10.10 \r\n首先谢谢作者，在这个作品开发之前，goagent在Mac上基本用不了\r\n但是还是有些小问题，例如CPU占用突然提高，风扇狂转\r\n因此我参考https://github.com/XX-net/XX-Net/issues/35 \r\n这里面的设置方法，导出了相关数据，希望可以对解决这个问题提供一定的帮助\r\n\r\n另外，出现该问题后，如果重启程序，或者 Reload Goagent 可以暂时解决\r\n以下为第一次\r\n\r\n 1766 function calls (1760 primitive calls) in 157.443 seconds\r\n\r\n   Ordered by: standard name\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n        3    0.000    0.000    0.000    0.000 SocketServer.py:206(__init__)\r\n        3    0.000    0.000    0.001    0.000 SocketServer.py:413(__init__)\r\n        3    0.000    0.000    0.001    0.000 SocketServer.py:422(server_bind)\r\n        3    0.000    0.000    0.000    0.000 SocketServer.py:433(server_activate)\r\n        1    0.000    0.000    0.000    0.000 cert_util.py:194(get_cert_serial_number)\r\n        1    0.000    0.000    0.019    0.019 cert_util.py:471(import_mac_ca)\r\n        1    0.000    0.000    0.019    0.019 cert_util.py:476(get_exist_ca_sha1)\r\n        1    0.000    0.000    0.019    0.019 cert_util.py:501(import_ca)\r\n        1    0.000    0.000    0.021    0.021 cert_util.py:514(init_ca)\r\n        1    0.000    0.000    0.000    0.000 config.py:130(info)\r\n        2    0.000    0.000    0.000    0.000 fnmatch.py:45(filter)\r\n        2    0.000    0.000    0.000    0.000 fnmatch.py:81(translate)\r\n        1    0.000    0.000    0.000    0.000 gae_handler.py:63(spawn_later)\r\n        2    0.000    0.000    0.000    0.000 genericpath.py:15(exists)\r\n        1    0.000    0.000    0.000    0.000 genericpath.py:85(_splitext)\r\n        2    0.000    0.000    0.001    0.000 glob.py:18(glob)\r\n       71    0.000    0.000    0.001    0.000 glob.py:29(iglob)\r\n        2    0.000    0.000    0.001    0.000 glob.py:66(glob1)\r\n       70    0.000    0.000    0.000    0.000 glob.py:77(<lambda>)\r\n        6    0.000    0.000    0.000    0.000 glob.py:94(has_magic)\r\n        2    0.000    0.000    0.000    0.000 logging.py:51(<lambda>)\r\n        1    0.000    0.000    0.000    0.000 logging.py:58(basicConfig)\r\n        1    0.000    0.000    0.000    0.000 logging.py:63(log)\r\n        1    0.000    0.000    0.000    0.000 logging.py:94(info)\r\n        1    0.000    0.000    0.000    0.000 posixpath.py:104(splitext)\r\n        1    0.000    0.000    0.000    0.000 posixpath.py:119(basename)\r\n        1    0.000    0.000    0.000    0.000 posixpath.py:127(dirname)\r\n        1    0.000    0.000    0.000    0.000 posixpath.py:139(islink)\r\n        2    0.000    0.000    0.000    0.000 posixpath.py:321(normpath)\r\n        2    0.000    0.000    0.000    0.000 posixpath.py:350(abspath)\r\n        2    0.000    0.000    0.000    0.000 posixpath.py:51(normcase)\r\n        2    0.000    0.000    0.000    0.000 posixpath.py:59(isabs)\r\n       69    0.000    0.000    0.000    0.000 posixpath.py:68(join)\r\n        2    0.000    0.000    0.000    0.000 posixpath.py:89(split)\r\n        1    0.000    0.000    0.001    0.001 proxy.py:126(pre_start)\r\n        1    0.000    0.000    0.000    0.000 random.py:271(choice)\r\n        2    0.000    0.000    0.000    0.000 re.py:188(compile)\r\n        9    0.000    0.000    0.000    0.000 re.py:204(escape)\r\n        2    0.000    0.000    0.000    0.000 re.py:226(_compile)\r\n        3    0.000    0.000    0.000    0.000 socket.py:185(__init__)\r\n       12    0.000    0.000    0.001    0.000 socket.py:223(meth)\r\n      4/2    0.000    0.000    0.000    0.000 sre_compile.py:32(_compile)\r\n        2    0.000    0.000    0.000    0.000 sre_compile.py:354(_simple)\r\n        2    0.000    0.000    0.000    0.000 sre_compile.py:359(_compile_info)\r\n        4    0.000    0.000    0.000    0.000 sre_compile.py:472(isstring)\r\n        2    0.000    0.000    0.000    0.000 sre_compile.py:478(_code)\r\n        2    0.000    0.000    0.000    0.000 sre_compile.py:493(compile)\r\n        8    0.000    0.000    0.000    0.000 sre_parse.py:126(__len__)\r\n       12    0.000    0.000    0.000    0.000 sre_parse.py:130(__getitem__)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:134(__setitem__)\r\n       13    0.000    0.000    0.000    0.000 sre_parse.py:138(append)\r\n      6/4    0.000    0.000    0.000    0.000 sre_parse.py:140(getwidth)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:178(__init__)\r\n       31    0.000    0.000    0.000    0.000 sre_parse.py:182(__next)\r\n       14    0.000    0.000    0.000    0.000 sre_parse.py:195(match)\r\n       27    0.000    0.000    0.000    0.000 sre_parse.py:201(get)\r\n        5    0.000    0.000    0.000    0.000 sre_parse.py:257(_escape)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:301(_parse_sub)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:379(_parse)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:67(__init__)\r\n        2    0.000    0.000    0.000    0.000 sre_parse.py:675(parse)\r\n        4    0.000    0.000    0.000    0.000 sre_parse.py:90(__init__)\r\n        1    0.000    0.000    0.000    0.000 stat.py:24(S_IFMT)\r\n        1    0.000    0.000    0.000    0.000 stat.py:55(S_ISLNK)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:1098(_get_handles)\r\n        4    0.000    0.000    0.000    0.000 subprocess.py:1147(_set_cloexec_flag)\r\n        2    0.000    0.000    0.000    0.000 subprocess.py:1160(pipe_cloexec)\r\n        1    0.000    0.000    0.003    0.003 subprocess.py:1186(_execute_child)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:1207(_close_in_parent)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:1329(_handle_exitstatus)\r\n        2    0.000    0.000    0.000    0.000 subprocess.py:1343(_internal_poll)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:1370(wait)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:458(_cleanup)\r\n        3    0.000    0.000    0.017    0.006 subprocess.py:473(_eintr_retry_call)\r\n        1    0.000    0.000    0.019    0.019 subprocess.py:544(check_output)\r\n        1    0.000    0.000    0.003    0.003 subprocess.py:648(__init__)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:753(__del__)\r\n        1    0.000    0.000    0.015    0.015 subprocess.py:767(communicate)\r\n        1    0.000    0.000    0.000    0.000 subprocess.py:801(poll)\r\n        3    0.000    0.000    0.000    0.000 threading.py:1008(daemon)\r\n        3    0.000    0.000    0.000    0.000 threading.py:1024(daemon)\r\n        3    0.000    0.000    0.000    0.000 threading.py:1035(setDaemon)\r\n        3    0.000    0.000    0.000    0.000 threading.py:1152(currentThread)\r\n        9    0.000    0.000    0.000    0.000 threading.py:241(Condition)\r\n        9    0.000    0.000    0.000    0.000 threading.py:259(__init__)\r\n        3    0.000    0.000    0.000    0.000 threading.py:293(_release_save)\r\n        3    0.000    0.000    0.000    0.000 threading.py:296(_acquire_restore)\r\n        3    0.000    0.000    0.000    0.000 threading.py:299(_is_owned)\r\n        3    0.000    0.000    0.000    0.000 threading.py:308(wait)\r\n        6    0.000    0.000    0.000    0.000 threading.py:541(Event)\r\n        6    0.000    0.000    0.000    0.000 threading.py:560(__init__)\r\n        6    0.000    0.000    0.000    0.000 threading.py:569(isSet)\r\n       18    0.000    0.000    0.000    0.000 threading.py:58(__init__)\r\n        3    0.000    0.000    0.000    0.000 threading.py:602(wait)\r\n        3    0.000    0.000    0.000    0.000 threading.py:627(_newname)\r\n        6    0.000    0.000    0.000    0.000 threading.py:63(_note)\r\n        3    0.000    0.000    0.000    0.000 threading.py:656(__init__)\r\n        3    0.000    0.000    0.000    0.000 threading.py:709(_set_daemon)\r\n        3    0.000    0.000    0.000    0.000 threading.py:726(start)\r\n        2    0.000    0.000    0.000    0.000 urllib2.py:1104(__init__)\r\n        1    0.000    0.000    0.000    0.000 urllib2.py:312(__init__)\r\n        9    0.000    0.000    0.000    0.000 urllib2.py:323(add_handler)\r\n        1    0.000    0.000    0.000    0.000 urllib2.py:454(build_opener)\r\n       10    0.000    0.000    0.000    0.000 urllib2.py:464(isclass)\r\n        8    0.000    0.000    0.000    0.000 urllib2.py:496(add_parent)\r\n       13    0.000    0.000    0.000    0.000 urllib2.py:503(__lt__)\r\n        1    0.000    0.000    0.000    0.000 urllib2.py:714(__init__)\r\n        2    0.000    0.000    0.000    0.000 {OpenSSL.crypto.load_certificate}\r\n        1    0.000    0.000    0.000    0.000 {__import__}\r\n        8    0.000    0.000    0.000    0.000 {_bisect.insort}\r\n        1    0.000    0.000    0.000    0.000 {_hashlib.openssl_md5}\r\n        2    0.000    0.000    0.000    0.000 {_sre.compile}\r\n        9    0.000    0.000    0.000    0.000 {dir}\r\n        8    0.000    0.000    0.000    0.000 {fcntl.fcntl}\r\n        1    0.000    0.000    0.000    0.000 {filter}\r\n        1    0.000    0.000    0.000    0.000 {gc.disable}\r\n        1    0.000    0.000    0.000    0.000 {gc.enable}\r\n        1    0.000    0.000    0.000    0.000 {gc.isenabled}\r\n       31    0.000    0.000    0.000    0.000 {getattr}\r\n       24    0.000    0.000    0.000    0.000 {hasattr}\r\n       43    0.000    0.000    0.000    0.000 {isinstance}\r\n    96/94    0.000    0.000    0.000    0.000 {len}\r\n       16    0.000    0.000    0.000    0.000 {method 'acquire' of 'thread.lock' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'add' of 'set' objects}\r\n      169    0.000    0.000    0.000    0.000 {method 'append' of 'list' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'bind' of '_socket.socket' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'close' of 'file' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'count' of 'list' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'digest' of 'X509' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'encode' of 'str' objects}\r\n       69    0.000    0.000    0.000    0.000 {method 'endswith' of 'str' objects}\r\n        2    0.000    0.000    0.000    0.000 {method 'extend' of 'list' objects}\r\n       90    0.000    0.000    0.000    0.000 {method 'find' of 'str' objects}\r\n       18    0.000    0.000    0.000    0.000 {method 'get' of 'dict' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'get_serial_number' of 'X509' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'getsockname' of '_socket.socket' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'hexdigest' of '_hashlib.HASH' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'items' of 'dict' objects}\r\n       12    0.000    0.000    0.000    0.000 {method 'join' of 'str' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'listen' of '_socket.socket' objects}\r\n       83    0.000    0.000    0.000    0.000 {method 'match' of '_sre.SRE_Pattern' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'random' of '_random.Random' objects}\r\n        3    0.016    0.005    0.016    0.005 {method 'read' of 'file' objects}\r\n        7    0.000    0.000    0.000    0.000 {method 'release' of 'thread.lock' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'remove' of 'list' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'remove' of 'set' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'replace' of 'str' objects}\r\n        6    0.000    0.000    0.000    0.000 {method 'rfind' of 'str' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'rstrip' of 'str' objects}\r\n        6    0.000    0.000    0.000    0.000 {method 'search' of '_sre.SRE_Pattern' objects}\r\n       14    0.000    0.000    0.000    0.000 {method 'setdefault' of 'dict' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'setsockopt' of '_socket.socket' objects}\r\n        2    0.000    0.000    0.000    0.000 {method 'split' of 'str' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'splitlines' of 'str' objects}\r\n      161    0.000    0.000    0.000    0.000 {method 'startswith' of 'str' objects}\r\n        1    0.000    0.000    0.000    0.000 {method 'update' of 'set' objects}\r\n        3    0.000    0.000    0.000    0.000 {method 'write' of 'file' objects}\r\n        8    0.000    0.000    0.000    0.000 {min}\r\n        2    0.000    0.000    0.000    0.000 {open}\r\n        9    0.000    0.000    0.000    0.000 {ord}\r\n        1    0.000    0.000    0.000    0.000 {posix.WEXITSTATUS}\r\n        1    0.000    0.000    0.000    0.000 {posix.WIFEXITED}\r\n        1    0.000    0.000    0.000    0.000 {posix.WIFSIGNALED}\r\n        1    0.000    0.000    0.000    0.000 {posix.chdir}\r\n        3    0.000    0.000    0.000    0.000 {posix.close}\r\n        1    0.000    0.000    0.000    0.000 {posix.fdopen}\r\n        1    0.001    0.001    0.001    0.001 {posix.fork}\r\n        2    0.000    0.000    0.000    0.000 {posix.listdir}\r\n        1    0.000    0.000    0.000    0.000 {posix.lstat}\r\n        2    0.000    0.000    0.000    0.000 {posix.pipe}\r\n        1    0.002    0.002    0.002    0.002 {posix.read}\r\n        2    0.000    0.000    0.000    0.000 {posix.stat}\r\n        1    0.000    0.000    0.000    0.000 {posix.waitpid}\r\n        1    0.000    0.000    0.000    0.000 {resource.setrlimit}\r\n       18    0.000    0.000    0.000    0.000 {setattr}\r\n       12    0.000    0.000    0.000    0.000 {thread.allocate_lock}\r\n        3    0.000    0.000    0.000    0.000 {thread.get_ident}\r\n        4    0.000    0.000    0.000    0.000 {thread.start_new_thread}\r\n        1    0.000    0.000    0.000    0.000 {time.ctime}\r\n      157  157.419    1.003  157.419    1.003 {time.sleep}"}}