{"action":"created","issue":{"url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/2","labels_url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/2/comments","events_url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/2/events","html_url":"https://github.com/ggrandes/apache24-modules/issues/2","id":82470968,"number":2,"title":"httpd process is using 100% CPU when myfixip module is enabled","user":{"login":"jackchen858","id":3376182,"avatar_url":"https://avatars.githubusercontent.com/u/3376182?v=3","gravatar_id":"","url":"https://api.github.com/users/jackchen858","html_url":"https://github.com/jackchen858","followers_url":"https://api.github.com/users/jackchen858/followers","following_url":"https://api.github.com/users/jackchen858/following{/other_user}","gists_url":"https://api.github.com/users/jackchen858/gists{/gist_id}","starred_url":"https://api.github.com/users/jackchen858/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackchen858/subscriptions","organizations_url":"https://api.github.com/users/jackchen858/orgs","repos_url":"https://api.github.com/users/jackchen858/repos","events_url":"https://api.github.com/users/jackchen858/events{/privacy}","received_events_url":"https://api.github.com/users/jackchen858/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ggrandes/apache24-modules/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"ggrandes","id":2364301,"avatar_url":"https://avatars.githubusercontent.com/u/2364301?v=3","gravatar_id":"","url":"https://api.github.com/users/ggrandes","html_url":"https://github.com/ggrandes","followers_url":"https://api.github.com/users/ggrandes/followers","following_url":"https://api.github.com/users/ggrandes/following{/other_user}","gists_url":"https://api.github.com/users/ggrandes/gists{/gist_id}","starred_url":"https://api.github.com/users/ggrandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggrandes/subscriptions","organizations_url":"https://api.github.com/users/ggrandes/orgs","repos_url":"https://api.github.com/users/ggrandes/repos","events_url":"https://api.github.com/users/ggrandes/events{/privacy}","received_events_url":"https://api.github.com/users/ggrandes/received_events","type":"User","site_admin":false},"milestone":null,"comments":23,"created_at":"2015-05-29T15:24:21Z","updated_at":"2015-07-07T20:16:03Z","closed_at":null,"body":"I am doing some testing with Amazon ELB's proxy protocol and apache 2.4.9 + myfixip now.\r\n\r\nThe module is working and I can get correct client IP in apache's access log. But I noticed after a while httpd process is trying to use as much as possible CPU.\r\n\r\ntop - 14:09:48 up 1 day, 19:56, 2 users, load average: 1.05, 1.30, 1.46\r\nTasks: 80 total, 2 running, 78 sleeping, 0 stopped, 0 zombie\r\nCpu(s): 5.7%us, 14.4%sy, 0.0%ni, 79.9%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st\r\nMem: 3857672k total, 3747412k used, 110260k free, 113828k buffers\r\nSwap: 0k total, 0k used, 0k free, 3517740k cached\r\nPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND\r\n30539 wwwrun 20 0 119m 3492 1584 R 99 0.1 5:43.91 httpd2-prefork\r\n\r\nstrace -p 30539 shows it's non-stop calling epoll_wait \r\n\r\nepoll_wait(27, {{EPOLLIN, {u32=2213386584, u64=139975197563224}}}, 2, 4294967295) = 1\r\nepoll_wait(27, {{EPOLLIN, {u32=2213386584, u64=139975197563224}}}, 2, 4294967295) = 1\r\nepoll_wait(27, {{EPOLLIN, {u32=2213386584, u64=139975197563224}}}, 2, 4294967295) = 1\r\nepoll_wait(27, {{EPOLLIN, {u32=2213386584, u64=139975197563224}}}, 2, 4294967295) = 1\r\n\r\n\r\nnetstat shows \r\nnetstat -nap | grep tcp | grep 30539\r\ntcp 0 0 172.31.4.10:54357 174.129.224.73:80 ESTABLISHED 30539/httpd2-prefor\r\ntcp 0 0 172.31.4.10:81 172.31.6.247:60080 CLOSE_WAIT 30539/httpd2-prefor\r\n\r\n\r\n172.31.6.247 is the ELB server with proxy protocol enable;\r\n172.31.4.10:81 is the apache server configured to proxy websocket traffic to ws://echo.websocket.org  ( I am just doing a test for websocket proxy).\r\n\r\nIt looks like the apache server didn't close the socket to ELB.\r\n\r\n\r\nDid a few tests, \r\n\r\n1. if myfixip is disabled and ELB proxy protocol is disabled, this problem doesn't happen;\r\n2. if myfixip is enabled but it's directly accessed by client ( so no request with proxy protocol ), this problem doesn't happen, I only see TIME_WAIT between apache server and my client.\r\n\r\n3. if myfixip is enabled, ELB proxy protocol is disabled, and I access the webserver through ELB ( still no request with proxy protocol ), this problem doesn't happen.\r\n\r\n4. only when myfixip is enabled and ELB proxy protocol is enabled and I access the webserver through ELB, this problem will happen.\r\n\r\n\r\nso it looks like it's related with myfixip module?\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/comments/119322112","html_url":"https://github.com/ggrandes/apache24-modules/issues/2#issuecomment-119322112","issue_url":"https://api.github.com/repos/ggrandes/apache24-modules/issues/2","id":119322112,"user":{"login":"awelters","id":2447955,"avatar_url":"https://avatars.githubusercontent.com/u/2447955?v=3","gravatar_id":"","url":"https://api.github.com/users/awelters","html_url":"https://github.com/awelters","followers_url":"https://api.github.com/users/awelters/followers","following_url":"https://api.github.com/users/awelters/following{/other_user}","gists_url":"https://api.github.com/users/awelters/gists{/gist_id}","starred_url":"https://api.github.com/users/awelters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awelters/subscriptions","organizations_url":"https://api.github.com/users/awelters/orgs","repos_url":"https://api.github.com/users/awelters/repos","events_url":"https://api.github.com/users/awelters/events{/privacy}","received_events_url":"https://api.github.com/users/awelters/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T20:16:03Z","updated_at":"2015-07-07T20:16:03Z","body":"the test env is no longer up.  I will try to retest in the coming weeks.  Thanks @ggrandes for the effort on this, very important project!"}}