+ -
当前位置:首页 → 问答吧 → 内核中大量的tcp overflow的报错,寻求解决方法

内核中大量的tcp overflow的报错,寻求解决方法

时间:2010-08-05

来源:互联网

一台Red hat 服务器,做负载交换,当连接达到上万后,内核里都报大量的这种错误,不知道各位有什么解决办法?
  1. printk: 7277 messages suppressed.
  2. TCP: time wait bucket table overflow
  3. printk: 16031 messages suppressed.
  4. TCP: time wait bucket table overflow
  5. printk: 8401 messages suppressed.
  6. TCP: time wait bucket table overflow
  7. printk: 4277 messages suppressed.
  8. TCP: time wait bucket table overflow
  9. printk: 8677 messages suppressed.
  10. TCP: time wait bucket table overflow
  11. printk: 1027 messages suppressed.
  12. TCP: time wait bucket table overflow
  13. printk: 4217 messages suppressed.
  14. TCP: time wait bucket table overflow
  15. printk: 5709 messages suppressed.
  16. TCP: time wait bucket table overflow
  17. TCP: time wait bucket table overflow
  18. TCP: time wait bucket table overflow
复制代码
另外想知道为什么会报这个错。谢谢。

作者: Coolriver   发布时间: 2010-08-05

  1.         struct inet_timewait_sock *tw = NULL;
  2.         const struct inet_connection_sock *icsk = inet_csk(sk);
  3.         const struct tcp_sock *tp = tcp_sk(sk);
  4.         int recycle_ok = 0;

  5.         if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp)
  6.                 recycle_ok = icsk->icsk_af_ops->remember_stamp(sk);

  7.         if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets)
  8.                 tw = inet_twsk_alloc(sk, state);

  9.         if (tw != NULL) {
  10.         ......
  11.         ......
  12.         ......
  13.         } else {
  14.                 /* Sorry, if we're out of memory, just CLOSE this
  15.                  * socket up.  We've got bigger problems than
  16.                  * non-graceful socket closings.
  17.                  */
  18.                 LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n");
  19.         }
复制代码
  1. struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state)
  2. {
  3.         struct inet_timewait_sock *tw =
  4.                 kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab,
  5.                                  GFP_ATOMIC);
  6.         if (tw != NULL) {
  7.                 ......
  8.                 ......
  9.                 ......
  10.         }

  11.         return tw;
  12. }
复制代码
综上分析,几种可能导致提示这句话:
1、在 tcp_death_row.tw_count >= tcp_death_row.sysctl_max_tw_buckets 的情况下
2、在调用 kmem_cache_alloc 分配 tw 错误的情况下

估计你的情况是由于 “1” 导致的
尝试用 sysctl 增大 net.ipv4.tcp_max_tw_buckets 试试

作者: platinum   发布时间: 2010-08-06

回复 platinum


    你是做LINUX C开发的吗?太强了,源码都找出来了。

作者: renxiao2003   发布时间: 2010-08-06



QUOTE:
回复  platinum


    你是做LINUX C开发的吗?太强了,源码都找出来了。
renxiao2003 发表于 2010-08-06 13:35



对于这种问题,最好的解决办法就是从代码入手,看因为什么提示

作者: platinum   发布时间: 2010-08-06

回复 platinum


    是的。但是也要有良好的C功能。我就是C太烂了。

作者: renxiao2003   发布时间: 2010-08-06

热门下载

更多