|
阅读:933回复:0
如何自动关闭空闲的sde连接?
在连接sde的应用中,如果连接的客户比较多的情况下,可能会出现sde连接占用cpu资源十分严重,以至于出现系统死机的情况。<br>
<br> Sde提供了TCPKEEPALIVE参数,用来侦测客户端连接情况。当TCPKEEPALIVE为True时,那么在2小时(TimeOut默认设置 7200000ms,即2小时)内,如果客户端没有向sde发送请求,sde连接将自动关闭,如果TCPKEEPALIVE为false,那么当客户端没 有向sde发送请求超过timeout规定时间,sde连接仍然占用。因此,如果我们想让系统自动关闭空闲的sde连接,那么我们就要把 TCPKEEPALIVE设置为true。默认安装的时候TCPKEEPALIVE的值为false。<br> <br> TCPKEEPALIVE参数可以通过sde命令来更改,例如:<br> Sdeconfig –o alter –v TCPKEEPALIVE=TRUE –u sde –p sde<br> 改完后重启sde服务。<br> <br> 注意:sde直连应用的情况下TCPKEEPALIVE参数不起作用。<br> <br> TCPKEEPALIVE的TimeOut时间是可以更改的,我们可以更改操作系统设置TimeOut间隔时间(5分钟-2小时)。例如:<br> On Microsoft Windows set KeepAliveTime to 300000. <br> \HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TCPIP\Parameters\KeepAliveTime<br> If the key does not already exist you will need to create it. <br> The time specified is in milliseconds. <br> On Sun Solaris use the ndd command with the -set option to configure the tcp_keepalive_interval. <br> <br> # ndd -set /dev/tcp tcp_keepalive_interval 300000<br> <br> The time specified is in milliseconds. <br> <br> On IBM AIX use the no command to set communication parameters.<br> no -o tcp_keepidle=591<br> <br> <br> <br> The time specified is in halfseconds. <br> <br> <br> <br> <br> <br> <br> On HP HP-UX use <br> <br> <br> <br> ndd -set /dev/tcp tcp_time_wait_interval 300000<br> <br> <br> <br> The time specified is in milliseconds. <br> <br> <br> <br> On RedHat Linux modify the following kernel parameter by editing the /etc/sysctl.conf file, and restart the network daemon (/etc/rc.d/init.d/network restart). <br> <br> <br> <br> # Decrease the time default value for tcp_keepalive_time<br> <br> <br> <br> tcp_keepalive_time = 1800<br> |
|
|