AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 27271
In Process
ctinnist
ctinnist
Asked: 2009-06-18 06:08:32 +0800 CST2009-06-18 06:08:32 +0800 CST 2009-06-18 06:08:32 +0800 CST

为什么 1GBit 卡的输出限制为 80 MiB?

  • 772

我正在尝试利用我的 1GiB 网卡提供的最大带宽,但它始终限于 80MiB(实际兆字节)。可能是什么原因?卡说明(lshw 输出):

   description: Ethernet interface
    product: DGE-530T Gigabit Ethernet Adapter (rev 11)
    vendor: D-Link System Inc
    physical id: 0
    bus info: pci@0000:03:00.0
    logical name: eth1
    version: 11
    serial: 00:22:b0:68:70:41
    size: 1GB/s
    capacity: 1GB/s
    width: 32 bits
    clock: 66MHz
    capabilities: pm vpd bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation

该卡放置在以下 PCI 插槽中:

*-pci:2
     description: PCI bridge
     product: 82801 PCI Bridge
     vendor: Intel Corporation
     physical id: 1e
     bus info: pci@0000:00:1e.0
     version: 92
     width: 32 bits
     clock: 33MHz
     capabilities: pci subtractive_decode bus_master cap_list

PCI不是任何PCI Express吗?这是一个传统的 PCI 插槽?所以也许这就是原因?

操作系统是linux。

linux networking ethernet gigabit-ethernet
  • 9 9 个回答
  • 7783 Views

9 个回答

  • Voted
  1. Russ Warren
    2009-06-18T06:17:27+08:002009-06-18T06:17:27+08:00

    80MB/秒其实还不错!这大约是 640mbps,非常接近 NIC 的千兆位容量。如果考虑 TCPIP 开销和磁盘速度,您可能处于最大速度。

    • 38
  2. SaveTheRbtz
    2009-06-18T06:23:14+08:002009-06-18T06:23:14+08:00

    试着把它放到你的 /etc/sysctl.conf

    # General 10gigabit/LFP tuning
    net.core.rmem_max=16777216
    net.core.wmem_max=16777216
    net.ipv4.tcp_rmem=4096 87380 16777216
    net.ipv4.tcp_wmem=4096 65536 16777216
    net.ipv4.tcp_syncookies=1
    net.ipv4.tcp_max_orphans=1048576
    net.ipv4.tcp_orphan_retries=2
    
    # Removes some internal buffering
    net.ipv4.tcp_low_latency=1
    
    # Time-wait sockets
    # Do not turn on unless you know what you are doing!
    #net.ipv4.tcp_tw_recycle=1
    #net.ipv4.tcp_tw_reuse=1
    
    # If PMTUD ICMP blackhole appears use
    # RFC 4821, Packetization Layer Path MTU Discovery
    net.ipv4.tcp_mtu_probing=1
    
    # Netfilter's conntrack
    # NB! For high-performance concerns you probably don't want to use `--state` rules at all 
    #net.ipv4.netfilter.ip_conntrack_max=1048576
    #net.nf_conntrack_max=1048576
    
    # SACKs are an optimization to TCP which in normal scenarios improves considerably performance. 
    # In Gigabit networks with no traffic competition these have the opposite effect. 
    # To improve performance they should be turned off with: 
    #net.ipv4.tcp_sack=0 
    
    # Decrease the time default value for tcp_fin_timeout connection
    net.ipv4.tcp_fin_timeout=15
    # Decrease the time default value for tcp_keepalive_time connection
    net.ipv4.tcp_keepalive_time=1800
    
    # Increased backlog (default: 100/1000 depending on kernel)
    net.core.netdev_max_backlog=10000
    net.core.somaxconn=10000
    
    # Timestamps adds additional 12 bytes to header and uses CPU
    # NB! It caused massive problems for me under benchmark load
    # with a high count of concurrent connections.
    # ( http://redmine.lighttpd.net/wiki/1/Docs:Performance )
    #net.ipv4.tcp_timestamps=0
    
    # Portrange for outgoing connections
    # (increase the ephemeral port range)
    # NB! After that tuning you probably do not want to listen on port >= 1024
    net.ipv4.ip_local_port_range=1024 65535
    
    # Fixing 'Too many open files', Second useful on nginx+aio workloads
    fs.file-max=16777216
    fs.aio-max-nr=65536
    
    # If you are under DDoS you can
    kernel.panic=10
    # Lower following values
    #net.ipv4.tcp_synack_retries=2
    #net.ipv4.tcp_syn_retries=2
    #net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait=15
    #net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait=15
    # If you under ping flood
    #net.ipv4.icmp_echo_ignore_all=1
    

    我们建立的每个连接都需要一个临时端口,因此需要一个文件描述符,默认情况下限制为 1024。为了避免打开文件过多的问题,您需要修改 shell 的 ulimit。这可以在 中更改/etc/security/limits.conf,但需要注销/登录。现在您可以只使用 sudo 并修改当前的 shell(如果您不想以 root 身份运行,请在调用 ulimit 后 su 回到您的非私有用户):

    ulimit -n 999999
    

    您可以尝试的另一件可能有助于增加 TCP 吞吐量的事情是增加接口队列的大小。为此,请执行以下操作:

    ifconfig eth0 txqueuelen 1000
    

    你可以玩拥塞控制:

    sysctl net.ipv4.tcp_available_congestion_control
    sysctl net.ipv4.tcp_congestion_control=htcp
    

    还有一些低级调优,例如内核模块参数

    # /sbin/modinfo e1000
    ..snip...
    parm:           TxDescriptors:Number of transmit descriptors (array of int)
    parm:           TxDescPower:Binary exponential size (2^X) of each transmit descriptor (array of int)
    parm:           RxDescriptors:Number of receive descriptors (array of int)
    parm:           Speed:Speed setting (array of int)
    parm:           Duplex:Duplex setting (array of int)
    parm:           AutoNeg:Advertised auto-negotiation setting (array of int)
    parm:           FlowControl:Flow Control setting (array of int)
    parm:           XsumRX:Disable or enable Receive Checksum offload (array of int)
    parm:           TxIntDelay:Transmit Interrupt Delay (array of int)
    parm:           TxAbsIntDelay:Transmit Absolute Interrupt Delay (array of int)
    parm:           RxIntDelay:Receive Interrupt Delay (array of int)
    parm:           RxAbsIntDelay:Receive Absolute Interrupt Delay (array of int)
    parm:           InterruptThrottleRate:Interrupt Throttling Rate (array of int)
    parm:           SmartPowerDownEnable:Enable PHY smart power down (array of int)
    parm:           KumeranLockLoss:Enable Kumeran lock loss workaround (array of int)
    parm:           copybreak:Maximum size of packet that is copied to a new buffer on receive 
    

    甚至可以通过ethtool(1).

    PS。阅读内核文档,尤其是Documentation/networking/scaling.txt

    聚苯乙烯。在调整 TCP 性能时,您可能需要参考RFC6349

    购买力平价。D-Link 不是最好的网络硬件。尝试使用 pci-x 或 pci-64 的 Intel 硬件

    • 21
  3. Chopper3
    2009-06-18T06:18:25+08:002009-06-18T06:18:25+08:00

    您的 32 位 33Mhz PCI 总线最多可以传输 1,067 兆比特每秒 (Mbps) 或 133.33 兆字节每秒 (MBps)。

    千兆以太网可以传输 116 兆字节/秒 (MBps)。

    因此,尽管您的卡应该能够使线路完全饱和,但由于各种开销,您实际上只能获得大约 90% 的利用率。

    无论哪种方式,如果您获得每秒 80 兆字节 (MBps) 的速度,那么您离我们不远了,我现在对此感到相当满意。

    • 8
  4. ConcernedOfTunbridgeWells
    2009-06-18T06:20:45+08:002009-06-18T06:20:45+08:00

    千兆以太网每秒刚刚超过 10 亿比特。使用 8/10 编码,每秒最多可以达到 100MB。一个 32 位 PCI 总线应该能够以 133MB/秒的速度通过并且你应该能够使其饱和(我可以用光纤通道卡演示 PCI 总线的饱和,并得到一个接近总线理论带宽的数字),因此,除非有其他公共汽车流量,否则它不太可能成为瓶颈的原因。

    除非您有另一张卡在总线上使用带宽,否则瓶颈可能在其他地方。

    • 2
  5. 3dinfluence
    2009-06-18T06:21:23+08:002009-06-18T06:21:23+08:00

    GigE 速度的瓶颈可能来自许多地方。

    • 磁盘子系统:在某种 RAID 阵列中至少需要 3-4 个硬盘驱动器才能达到 GigE 速度。在发送端和接收端都是如此。
    • CPU:GigE 可以使用比您想象的更多的 CPU。鉴于它位于 33mhz PCI 插槽中,我将在这里冒昧地说这个系统相当老旧并且可能有一个较慢的 CPU。
    • TCP/IP 开销:通过线路发送的某些位不是数据有效负载,而是其他开销位。这就是说我有一个系统可以通过单个 GigE 链接持续达到并维持 115MB/s。
    • PCI 总线: NIC 是该 PCI 总线上唯一的东西,还是与其他设备共享。
    • 其他因素:还有很多其他因素无法一一提及,但其中一些最大的因素是其他磁盘 IO 活动正在发生什么。它是读/写、大量小 IO 请求等的混合吗?
    • 1
  6. Shial
    2009-06-18T06:22:42+08:002009-06-18T06:22:42+08:00

    您有多确定卡是瓶颈?这可能是它可以与另一端的设备协商的最佳速度,因此它处于等待状态。另一台设备可能会卡在以 10/100 的速度运行,因此 80 大约是正确的,但需要一点开销。

    • 0
  7. ctinnist
    2009-06-25T01:05:19+08:002009-06-25T01:05:19+08:00

    经过长期的研究,我发表了我的结论:

    1. 进程关联和 NIC irq 关联必须固定且相等。应该停止 irqbalance 进程 (Linux)。
    2. 该卡必须在其 PCIe 模式下运行,例如 x4。如果 PCIe 插槽不支持此模式,则卡将以 x1 模式运行,从而导致瓶颈。
    • 0
  8. Roy
    2009-10-21T01:24:07+08:002009-10-21T01:24:07+08:00

    以我的经验,80 MiB/s 相当不错。无论使用哪种 NIC 和交换机组合,我都没有看到更高的速度。我记得 100 Mbps 表现出几乎相同的行为。70-80% 的利用率几乎是你所能要求的,尽管我看到这些天千兆设备在 100 Mbps 模式下运行在 90% 以上。

    相比之下,我在家里的第一个千兆配置,基于 SMC 交换机和 Broadcom 集成 NIC,几乎无法管理 400 Mbps。现在,多年后,使用 Netgear 管理交换机以及 Intel 和 Marlin NIC,我通常发现自己处于 70-80 MiB/s 的持续传输范围内。

    如果您需要更多,请考虑绑定多个接口。

    • 0
  9. Rajat
    2009-10-25T20:17:44+08:002009-10-25T20:17:44+08:00

    如果可以检查您的开关端,您的速度会非常好

    http://www.cisco.com/en/US/tech/tk389/tk213/technologies_configuration_example09186a0080094470.shtml

    • 0

相关问题

  • 更改 PHP 的默认配置设置?

  • 有什么软件可以模拟局域网?

  • 保护新的 Ubuntu 服务器 [关闭]

  • 带宽利用工具?[关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    Windows 中执行反向 DNS 查找的命令行实用程序是什么?

    • 14 个回答
  • Marko Smith

    如何检查 Windows 机器上的端口是否被阻塞?

    • 4 个回答
  • Marko Smith

    我应该打开哪个端口以允许远程桌面?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    kch 如何更改我的私钥密码? 2009-08-06 21:37:57 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve