如何自动关闭空闲的sde连接?

在连接sde的应用中,如果连接的客户比较多的情况下,可能会出现sde连接占用cpu资源十分严重,以至于出现系统死机的情况。

Sde提供了TCPKEEPALIVE参数,用来侦测客户端连接情况。当TCPKEEPALIVE为True时,那么在2小时(TimeOut默认设置7200000ms,即2小时)内,如果客户端没有向sde发送请求,sde连接将自动关闭,如果TCPKEEPALIVE为false,那么当客户端没有向sde发送请求超过timeout规定时间,sde连接仍然占用。因此,如果我们想让系统自动关闭空闲的sde连接,那么我们就要把TCPKEEPALIVE设置为true。默认安装的时候TCPKEEPALIVE的值为false。

TCPKEEPALIVE参数可以通过sde命令来更改,例如:
Sdeconfig –o alter –v TCPKEEPALIVE=TRUE –u sde –p sde
改完后重启sde服务。

注意:sde直连应用的情况下TCPKEEPALIVE参数不起作用。

TCPKEEPALIVE的TimeOut时间是可以更改的,我们可以更改操作系统设置TimeOut间隔时间(5分钟-2小时)。例如:
       On Microsoft Windows set KeepAliveTime to 300000.
\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TCPIP\Parameters\KeepAliveTime
If the key does not already exist you will need to create it.
The time specified is in milliseconds.
       On Sun Solaris use the ndd command with the -set option to configure the tcp_keepalive_interval.

# ndd -set /dev/tcp tcp_keepalive_interval 300000

The time specified is in milliseconds.

       On IBM AIX use the no command to set communication parameters.
no -o tcp_keepidle=591



The time specified is in halfseconds.






       On HP HP-UX use



ndd -set /dev/tcp tcp_time_wait_interval 300000



The time specified is in milliseconds.



       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).



             # Decrease the time default value for tcp_keepalive_time



tcp_keepalive_time = 1800


http://bbs.esrichina-bj.cn/esri/viewthread.php?tid=8021


转载于:https://www.cnblogs.com/njlhb/archive/2007/08/04/843106.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值