{"action":"created","issue":{"url":"https://api.github.com/repos/01org/QAT_Engine/issues/32","repository_url":"https://api.github.com/repos/01org/QAT_Engine","labels_url":"https://api.github.com/repos/01org/QAT_Engine/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/01org/QAT_Engine/issues/32/comments","events_url":"https://api.github.com/repos/01org/QAT_Engine/issues/32/events","html_url":"https://github.com/01org/QAT_Engine/issues/32","id":256567069,"number":32,"title":"(qat) low performance in multi-thread  app","user":{"login":"13530654732","id":19210925,"avatar_url":"https://avatars0.githubusercontent.com/u/19210925?v=4","gravatar_id":"","url":"https://api.github.com/users/13530654732","html_url":"https://github.com/13530654732","followers_url":"https://api.github.com/users/13530654732/followers","following_url":"https://api.github.com/users/13530654732/following{/other_user}","gists_url":"https://api.github.com/users/13530654732/gists{/gist_id}","starred_url":"https://api.github.com/users/13530654732/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/13530654732/subscriptions","organizations_url":"https://api.github.com/users/13530654732/orgs","repos_url":"https://api.github.com/users/13530654732/repos","events_url":"https://api.github.com/users/13530654732/events{/privacy}","received_events_url":"https://api.github.com/users/13530654732/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"stevelinsell","id":15036083,"avatar_url":"https://avatars2.githubusercontent.com/u/15036083?v=4","gravatar_id":"","url":"https://api.github.com/users/stevelinsell","html_url":"https://github.com/stevelinsell","followers_url":"https://api.github.com/users/stevelinsell/followers","following_url":"https://api.github.com/users/stevelinsell/following{/other_user}","gists_url":"https://api.github.com/users/stevelinsell/gists{/gist_id}","starred_url":"https://api.github.com/users/stevelinsell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevelinsell/subscriptions","organizations_url":"https://api.github.com/users/stevelinsell/orgs","repos_url":"https://api.github.com/users/stevelinsell/repos","events_url":"https://api.github.com/users/stevelinsell/events{/privacy}","received_events_url":"https://api.github.com/users/stevelinsell/received_events","type":"User","site_admin":false},"assignees":[{"login":"stevelinsell","id":15036083,"avatar_url":"https://avatars2.githubusercontent.com/u/15036083?v=4","gravatar_id":"","url":"https://api.github.com/users/stevelinsell","html_url":"https://github.com/stevelinsell","followers_url":"https://api.github.com/users/stevelinsell/followers","following_url":"https://api.github.com/users/stevelinsell/following{/other_user}","gists_url":"https://api.github.com/users/stevelinsell/gists{/gist_id}","starred_url":"https://api.github.com/users/stevelinsell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevelinsell/subscriptions","organizations_url":"https://api.github.com/users/stevelinsell/orgs","repos_url":"https://api.github.com/users/stevelinsell/repos","events_url":"https://api.github.com/users/stevelinsell/events{/privacy}","received_events_url":"https://api.github.com/users/stevelinsell/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2017-09-11T02:44:24Z","updated_at":"2017-09-20T01:51:16Z","closed_at":null,"author_association":"NONE","body":"i developed a multi-thread demo app which is almost the same with nginx \r\napp: 32 worker  threads   VS  nginx 32 worker process\r\napp: worker handle accept4 and IO events  VS  nginx worker process handle accept4 and IO events (with accept_mutex off)\r\n\r\nserver information:\r\nXeon 2670(v2?)  X2\r\nwith dh8950 device\r\n\r\ntest deployment mode:\r\nsprient testcenter ------https--------nginx/app\r\n\r\nnginx with qat can run over 15000+ connections per second HTTPS(RSA2048+AES256-SHA1) requests  ( the whole cpu usage is less than 30%)\r\n\r\nbut when i switch to my app(with qat support),  my app can run only 7800 connections perf second HTTPS(RSA2048+AES256-SHA1) requests( the whole cpu usage is almost 100%)\r\n\r\nI can find some offical metric statistics that looks pretty , but i guess those statistics are tests in multi-process enviroment.\r\n\r\ni am wondering if my app's result is normal? or there is some metric data to compare with ?\r\n\r\nor there is multi-thread demo like nginx(qat)  to follow ?\r\n\r\nthanks "},"comment":{"url":"https://api.github.com/repos/01org/QAT_Engine/issues/comments/330722054","html_url":"https://github.com/01org/QAT_Engine/issues/32#issuecomment-330722054","issue_url":"https://api.github.com/repos/01org/QAT_Engine/issues/32","id":330722054,"user":{"login":"13530654732","id":19210925,"avatar_url":"https://avatars0.githubusercontent.com/u/19210925?v=4","gravatar_id":"","url":"https://api.github.com/users/13530654732","html_url":"https://github.com/13530654732","followers_url":"https://api.github.com/users/13530654732/followers","following_url":"https://api.github.com/users/13530654732/following{/other_user}","gists_url":"https://api.github.com/users/13530654732/gists{/gist_id}","starred_url":"https://api.github.com/users/13530654732/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/13530654732/subscriptions","organizations_url":"https://api.github.com/users/13530654732/orgs","repos_url":"https://api.github.com/users/13530654732/repos","events_url":"https://api.github.com/users/13530654732/events{/privacy}","received_events_url":"https://api.github.com/users/13530654732/received_events","type":"User","site_admin":false},"created_at":"2017-09-20T01:51:16Z","updated_at":"2017-09-20T01:51:16Z","author_association":"NONE","body":"@stevelinsell \r\nthanks for your reply.\r\n\r\nyou metioned that i should use multi-thread-qaememutils instead of qae_mem_utils, yes i did.\r\nIf i use qae_mem_utils.c , the multi-threads app crashs. So i have to use multi_thread_qaememutils.c\r\n\r\ni both export a global var  export MULTI_THREAD_MEMUTILS=/home/fc/openssl-asynch//engines/qat_engine\r\nand add a global MACRO declaration -DMULTI_THREAD_MEMUTILS when compiling openssl-asynch, it compile qae_mem_utils.c into openssl-async\r\n\r\nand i have compiled a -g3 debug version of my app, including libcrypto/libssl/server3. \r\ni did debugging server3 and checking the thread local memory pool allocation, it works.\r\n\r\nfrom the perf report, i can see top 3 hotspot\r\n1) kernel space lock/unlock---------i guess it should be due to QAT engine driver\r\n2) user space mutex lock/unlock-----i guess it should be on openssl and qat engine user code\r\n3) openssl malloc/free\r\ni cann't find a way to optimize all these 3 hotspot\r\n\r\nthanks again!"}}
{"actor":{"display_login":"13530654732"}}