Apache部分
regedit裡新增兩個十進位DWORD
[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \AFD \Parameters]
DefaultReceiveWindow = 327680
DefaultSendWindow = 327680
資料來源http://smallvoid.com/article/winnt-winsock-buffer.html
Configure the winsock default send- and receive-buffer size
12 October 2002 by Snakefoot | Comment » | Trackback OffUsually when reading about TCPIP there is only mentioned one Receive Window for a connection, which is used to control congestion created by network latency.
In the WinNT network architecture a layer is placed on top of the TCPIP layer called AFD(Ancillary Function Driver for Winsock). The AFD provides the winsock interface, which is used by most network applications in Windows and is also supporting things like DNS and DHCP.
The AFD uses two windows which acts as a flowcontrol for the application creating the socket:
To set the default size of the AFD-Windows use the following DWORD registry keys :
Related : Recommended settings for the TCP/IP stack
More Info MSDN - Write Scalable Winsock Apps Using Completion Ports
More info MS KB Q214397
More info MS KB Q246984
More info MS KB Q311084
In the WinNT network architecture a layer is placed on top of the TCPIP layer called AFD(Ancillary Function Driver for Winsock). The AFD provides the winsock interface, which is used by most network applications in Windows and is also supporting things like DNS and DHCP.
The AFD uses two windows which acts as a flowcontrol for the application creating the socket:
- Send Window: Used when the application is sending data over a connection, if more data is sent than the receiver is able to acknowledge then the AFD-Send-Window will block the transfer for the application, when it reaches the limit of the AFD-Send-Window. The application creating the socket can use setsockopt to adjust SO_SNDBUF.
- Receive Window: Acts just like the TCPIP-Receive Window, and when creating a Winsocket over TCPIP, then AFD will use the TCPIP Receive Window as AFD-Receive Window. The application creating the socket can use setsockopt to adjust SO_RCVBUF.
- 4096 bytes if less than 19 MByte RAM
- 8192 bytes if more than 19 MByte RAM
To set the default size of the AFD-Windows use the following DWORD registry keys :
Note that the AFD-Windows should be rounded to a multiple of memory page size (Usually 4096 Bytes). Not a multiple of the Maximum Segment Size(MSS) which is recommended for the TCPIP-Window.[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \Afd \Parameters]
DefaultReceiveWindow = 16384
DefaultSendWindow = 16384
Related : Recommended settings for the TCP/IP stack
More Info MSDN - Write Scalable Winsock Apps Using Completion Ports
More info MS KB Q214397
More info MS KB Q246984
More info MS KB Q311084
FTP部分
簡單來說就是transfer buffer size需要加大。之前我的設定32768結果卡在2MB/s(我的上限是4MB/s),改成3276800後現在正常了,寫在這邊供需要的人參考。
資料來源:http://trac.filezilla-project.org/ticket/820
Ticket #820 (closed Bug report)
FileZilla Server incredibly slow
Reported by: | prezla | Owned by: | ci-dev |
---|---|---|---|
Priority: | normal | Component: | FileZilla Server |
Keywords: | Cc: | prezla, ci-dev, codesquid | |
Operating system type: | Operating system version: |
Description
FileZilla Server 0.9.5 is incredibly slow. I was
running it for and FTP server, but have since swapped
it out for WARFTPd 1.82.0.10 because of the following
performance numbers (notice that FileZilla is almost 3
times slower than WARFTPd, and Microsoft FTP is only
about 1 sec slower than WARFTPd):
FileZilla Server 0.9.5:
ftp> get catalog.pdf
200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
ftp: 42509572 bytes received in 18.24Seconds
2330.95Kbytes/sec.
Microsoft FTP Server 5.1 (XP):
ftp> get catalog.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for
catalog.pdf(42509572 bytes).
226 Transfer complete.
ftp: 42509572 bytes received in 8.14Seconds
5221.02Kbytes/sec.
WARFTPd 1.82.00-RC10:
ftp> get catalog.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for catalog.pdf
(42509572 bytes).
226 Transfer complete. 42509572 bytes in 7.00 sec.
(5930.465 Kb/s)
ftp: 42509572 bytes received in 6.99Seconds
6080.61Kbytes/sec.
My platform is:
Intel Pentium III 933
512 MB RAM
Microsoft Windows XP SP2
running it for and FTP server, but have since swapped
it out for WARFTPd 1.82.0.10 because of the following
performance numbers (notice that FileZilla is almost 3
times slower than WARFTPd, and Microsoft FTP is only
about 1 sec slower than WARFTPd):
FileZilla Server 0.9.5:
ftp> get catalog.pdf
200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
ftp: 42509572 bytes received in 18.24Seconds
2330.95Kbytes/sec.
Microsoft FTP Server 5.1 (XP):
ftp> get catalog.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for
catalog.pdf(42509572 bytes).
226 Transfer complete.
ftp: 42509572 bytes received in 8.14Seconds
5221.02Kbytes/sec.
WARFTPd 1.82.00-RC10:
ftp> get catalog.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for catalog.pdf
(42509572 bytes).
226 Transfer complete. 42509572 bytes in 7.00 sec.
(5930.465 Kb/s)
ftp: 42509572 bytes received in 6.99Seconds
6080.61Kbytes/sec.
My platform is:
Intel Pentium III 933
512 MB RAM
Microsoft Windows XP SP2
沒有留言:
張貼留言