apache 遇到[error] (OS 10038) 错误

99 views
Skip to first unread message

管理员

unread,
Nov 26, 2007, 11:03:46 AM11/26/07
to 一起赚·流量营销专家
我的机器是windows server 2003 主要是用作开发用,除了apache 还装了很多其他软件;

首先一次重新启动后遇到了这个问题:
taskmanager 里有两个httpd进程,其中一个占用cpu 很高 于是去查看event viewer 没有看到问
题...........
去看error.log 果然问题出在这里,里面有好多个这样的错误,看来是陷入死循环了。

error] (OS 10038) : Child 3356: Encountered too many errors accepting
client connections. Possible causes: dynamic address renewal, or
incompatible VPN or firewall software. Try using the
Win32DisableAcceptEx directive.

于是我很开心的去网上查解决办法,去了几个国内论坛也去了几个国外的论坛,最先找到的解决办法都是:

解决方法:
编辑httpd.conf

在文件尾加入下面一行


Win32DisableAcceptEx



重启apache

可是我的问题就是还没有解决,以出现了新的问题


Fri Jun 01 10:15:27 2007] [notice] Apache/2.2.3 (Win32) PHP/5.1.4
configured -- resuming normal operations
[Fri Jun 01 10:15:27 2007] [notice] Server built: Jul 27 2006 16:49:49
[Fri Jun 01 10:15:27 2007] [notice] Parent: Created child process 3344
[Fri Jun 01 10:15:27 2007] [notice] Disabled use of AcceptEx()
WinSock2 API
[Fri Jun 01 10:15:29 2007] [notice] Child 3344: Child process is
running
[Fri Jun 01 10:15:29 2007] [notice] Child 3344: Acquired the start
mutex.
[Fri Jun 01 10:15:29 2007] [notice] Child 3344: Starting 250 worker
threads.
[Fri Jun 01 10:15:29 2007] [notice] Child 3344: Listening on port 80.
[Fri Jun 01 10:15:29 2007] [error] (OS 10038)An operation was
attempted on something that is not a socket. : Too many errors in
select loop. Child process exiting.
[Fri Jun 01 10:15:29 2007] [notice] Child 3344: Exit event signaled.
Child process is ending.
[Fri Jun 01 10:15:30 2007] [notice] Child 3344: Released the start
mutex
[Fri Jun 01 10:15:30 2007] [notice] Child 3344: Waiting for 250 worker
threads to exit.
[Fri Jun 01 10:15:30 2007] [notice] Child 3344: All worker threads
have exited.
[Fri Jun 01 10:15:30 2007] [notice] Child 3344: Child process is
exiting
[Fri Jun 01 10:15:30 2007] [notice] Parent: child process exited with
status 0 -- Restarting.
[Fri Jun 01 10:15:31 2007] [notice] Apache/2.2.3 (Win32) PHP/5.1.4
configured -- resuming normal operations
[Fri Jun 01 10:15:31 2007] [notice] Server built: Jul 27 2006 16:49:49
[Fri Jun 01 10:15:31 2007] [notice] Parent: Created child process 288
[Fri Jun 01 10:15:31 2007] [notice] Disabled use of AcceptEx()
WinSock2 API
[Fri Jun 01 10:15:32 2007] [notice] Child 288: Child process is
running
[Fri Jun 01 10:15:32 2007] [notice] Child 288: Acquired the start
mutex.
[Fri Jun 01 10:15:32 2007] [notice] Child 288: Starting 250 worker
threads.
[Fri Jun 01 10:15:32 2007] [notice] Child 288: Listening on port 80.
[Fri Jun 01 10:15:32 2007] [error] (OS 10038)An operation was
attempted on something that is not a socket. : Too many errors in
select loop. Child process exiting.





就这样的不停重复。。。。。。。。。。。
于是继续找。。同时在http server 的文档上查了一下Win32DisableAcceptEx 这个命令
同时找到下面两个可以说是建议吧:
一、Udpsocket Wsa Error = 10038
首先这也是个10038错误,和winsock相关,我觉得可能有用就看了一下
问题是这样陈述的:
HI,

cAN ANYBODY HELP IN THE FOLLOWING ERROR:

I STARTED MY SYS TODAY , AND IT SHOWED ME THE ERROR " UDPSOCKET" AND
THEN IN ANOTHER DIALOGBOX IT SAID " WSA ERROR = 10038"

NOW I M UNABLE TO CONNECT TO THE NETWORKING MACHINES AND NOR CAN I
CONNECT TO THE INTERNET.


CAN ANYBODY HELP IN THIS REGARD ? WD REALLY APPRECIATE THAT .

IT'S PRETTY URGENT.

REGARDS
ARUN


mlegg 给出了解决办法:
If you have updated Windows and have SP2 (you should by now)
Go to the Start button > to the Run box > type cmd and the command
window opens

now type: netsh winsock reset

this will repair your corrupted Winsock

if you do not have SP2 yet for some reason, then read this page from
MS on how to repair your Winsock


Afterwards go to Windows Updates and get everything you do not have
yet. There has been a lot of updates and patches over the last few
months. They come out the 2nd Tuesday of every month, but this month
they were released early to fix a critical patch.


同时我也在同时在http server 的文档上看到Win32DisableAcceptEx (使用accept()代替AcceptEx()接
受网络链接)这个命令,有一个关于AcceptEx()的介绍:AcceptEx()是一个微软的WinSock2 API ,通过使用BSD风格的
accept() API提供了性能改善。一些流行的Windows产品,比如防病毒软件或虚拟专用网络软件,会干扰AcceptEx()的正确操作。
如果你遇到类似于如下的错误:
[error] (730038)An operation was attempted on something that is not a
socket.: winnt_accept: AcceptEx failed. Attempting to recover.

你就需要使用这个指令来禁止使用AcceptEx() 。




于是我使用了netsh winsock reset命令也把Symantec AntiVirus 卸载了
重新启动,问题解决


后记:
问题虽然解决了,但是从头到尾还没有完全搞清楚, 还有两个疑问:(1)还是不知道问题到底是怎么产生的,我以前就一真用Symantec
AntiVirus,如果是因为它,为什么到现在才产生这个问题,如果说是由于更新病毒库的原因,我自己也不能说服我自己相信这个理由(2)如果是由于
系统升级产生的问题那么为什么会产生这个问题?呵呵,饿了,先去吃饭,回来再解决之两个疑问

我又重新把Symantec AntiVirus装起,呀,没有问题,不知道问题是怎么产生的了,就是Symantec AntiVirus还没有更新
病毒库呢,哈,学校的网络有点差,毕竟是教育网,怎样才让访问国外的网站速度快一点呢?....

总这可以确定是winsock2 corrupted 了要用 netsh winsock reset 恢复而不是用
Win32DisableAcceptEx 把 acceptex() 关掉

管理员

unread,
Nov 26, 2007, 1:48:11 PM11/26/07
to 一起赚·流量营销专家
文章引用地址:http://www.neo.com.tw/archives/000223.html

我電腦上的 Apache 版本是 2.0.49,這陣子只要一重機開機,有時 CPU 的資源就被 Apache 給佔走了,而且硬碟的燈一直在
閃。


今天因為開始要撰寫 WaShop 專案了,所以大概看了 Log 開始發生問題的區段是:


[Tue Jun 15 12:03:15 2004] [error] (OS 10038)嘗試操作的對象不是通訊端。 : Child
1556: Encountered too many errors accepting client connections.
Possible causes: dynamic address renewal, or incompatible VPN or
firewall software. Try using the Win32DisableAcceptEx directive.


依照上面的訊息,關掉防火牆跟防毒軟體還是一樣的狀況,後來依照他的提示要使用 Win32DisableAcceptEx 指令。


所以只要看到 Log 有寫 Win32DisableAcceptEx 或 AcceptEx failed 之類的字眼,就該把
AcceptEx() 關掉了,而關掉的方法就是在 httpd.conf 內加入 Win32DisableAcceptEx 。


Win32DisableAcceptEx 顧名思義就是在 Windows 下關掉 AcceptEx() 功能的指令。至於
AcceptEx() 這個東西是什麼,可以參考 Apache 的官方網頁:


http://httpd.apache.org/docs-2.0/mod/mpm_winnt.html#win32disableacceptex


原文如下:
AcceptEx() is a Microsoft WinSock v2 API that provides some
performance improvements over the use of the BSD style accept() API
in
certain circumstances. Some popular Windows products, typically virus
scanning or virtual private network packages, have bugs that
interfere
with the proper operation of AcceptEx(). If you encounter an error
condition like:


[error] (730038)An operation was attempted on something that is not a
socket.: winnt_accept: AcceptEx failed. Attempting to recover.


you should use this directive to disable the use of AcceptEx().


主要是說這 AcceptEx() 是 Microsoft WinSock v2 API 一組提升網路效率 API 中的指令。而且在
Windows 上似乎蠻有可能出問題的。


註:可能為了效能還是預設為開啟 AcceptEx()


如果無預警的發生問題,我猜可能是 Windows Update 或是防火牆、防毒軟體更新了某些網路原件,造成 Microsoft
WinSock v2 API 動作不正常,這時可以把這個功能先給關掉。


依照官方說明 , Win32DisableAcceptEx 這個功能,只有 2.0.49 版以後的才可以使用,所以我猜測
AcceptEx() 這個指令大概也是 2.0.49 才會開始支援(目前最新的就是 2.0.49)。


關掉 AcceptEx() 的方式只要在 httpd.conf 找到 <IfModule mpm_winnt.c> 區段,加入
Win32DisableAcceptEx 就可以了。


<IfModule mpm_winnt.c>
Win32DisableAcceptEx #加入這一行
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>


然後重新啟動 Apache ,動作果然都正常了。





管理员

unread,
Nov 26, 2007, 1:48:19 PM11/26/07
to 一起赚·流量营销专家
文章引用地址:http://www.csjh.tcc.edu.tw/phpbbinf/viewtopic.php?p=22344


EnableMMAP off
EnableSendfile off
Win32DisableAcceptEx
Reply all
Reply to author
Forward
0 new messages