aboutsummaryrefslogtreecommitdiffstats
path: root/ftp
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1995-10-09 13:27:19 +0800
committergibbs <gibbs@FreeBSD.org>1995-10-09 13:27:19 +0800
commitb1a7b316aa3eb9610f5e8f888b8d3bca8828319b (patch)
tree0395da8a7b906b4abd5c185a83f915fc2705ab90 /ftp
parent013cbe0f456db0969411cf1d551e960df044f1ad (diff)
downloadfreebsd-ports-graphics-b1a7b316aa3eb9610f5e8f888b8d3bca8828319b.tar.gz
freebsd-ports-graphics-b1a7b316aa3eb9610f5e8f888b8d3bca8828319b.tar.zst
freebsd-ports-graphics-b1a7b316aa3eb9610f5e8f888b8d3bca8828319b.zip
Tune wu-ftpd for high performance:
- Link ftpd static - big win since it forks so often. - Turn off push flag to keep sender TCP from sending short packets at the boundaries of each write(). Should probably do a SO_SNDBUF to set the send buffer size as well, but that may not be desirable in heavy-load situations. - Double the send buffer size. - Add an option to config.h, LOG_TOOMANY, defined by default, that controls whether we bother to complain when a connection hits a user limit. Turning this off removes at least 3/4 of the syslog usage of wu-ftpd on a busy system saving CPU and logspace. - Make SKEY portions truely optional by one knob in the src Makefile Obtained from: David Greenman <davidg@FreeBSD.org> and wcarchive
Diffstat (limited to 'ftp')
-rw-r--r--ftp/wu-ftpd+ipv6/files/patch-ai73
-rw-r--r--ftp/wu-ftpd/files/patch-ai73
2 files changed, 146 insertions, 0 deletions
diff --git a/ftp/wu-ftpd+ipv6/files/patch-ai b/ftp/wu-ftpd+ipv6/files/patch-ai
new file mode 100644
index 00000000000..0dc7c97dcdc
--- /dev/null
+++ b/ftp/wu-ftpd+ipv6/files/patch-ai
@@ -0,0 +1,73 @@
+*** config.h Fri Apr 1 11:03:59 1994
+--- config.h Sat Oct 7 10:09:48 1995
+***************
+*** 30,35 ****
+--- 30,43 ----
+ #define LOG_FAILED
+
+ /*
++ * log login attempts that fail because of class connection
++ * limits. Busy servers may want to prevent this logging
++ * since it can fill up the log file and put a high load on
++ * syslog.
++ */
++ #define LOG_TOOMANY
++
++ /*
+ * allow use of private file. (for site group and site gpass)
+ */
+
+*** src/access.c Sat Oct 7 07:52:31 1995
+--- src/access.c Sat Oct 7 10:10:04 1995
+***************
+*** 803,810 ****
+--- 803,812 ----
+ acl_join(class);
+ return (1);
+ } else {
++ #ifdef LOG_TOOMANY
+ syslog(LOG_NOTICE, "ACCESS DENIED (user limit %d; class %s) TO %s [%s]",
+ limit, class, remotehost, remoteaddr);
++ #endif
+ pr_mesg(msgcode, msgfile);
+ return (-1);
+ }
+*** src/ftpd.c Sat Oct 7 07:52:30 1995
+--- src/ftpd.c Fri Oct 6 23:48:59 1995
+***************
+*** 1435,1441 ****
+ if (dout == NULL)
+ goto done;
+ #ifdef HAVE_ST_BLKSIZE
+! send_data(fin, dout, st.st_blksize);
+ #else
+ send_data(fin, dout, BUFSIZ);
+ #endif
+--- 1435,1441 ----
+ if (dout == NULL)
+ goto done;
+ #ifdef HAVE_ST_BLKSIZE
+! send_data(fin, dout, st.st_blksize*2);
+ #else
+ send_data(fin, dout, BUFSIZ);
+ #endif
+***************
+*** 1718,1723 ****
+--- 1718,1734 ----
+ on = IPTOS_THROUGHPUT;
+ if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *) &on, sizeof(int)) < 0)
+ syslog(LOG_WARNING, "setsockopt (IP_TOS): %m");
++ #endif
++ #ifdef TCP_NOPUSH
++ /*
++ * Turn off push flag to keep sender TCP from sending short packets
++ * at the boundaries of each write(). Should probably do a SO_SNDBUF
++ * to set the send buffer size as well, but that may not be desirable
++ * in heavy-load situations.
++ */
++ on = 1;
++ if (setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, (char *)&on, sizeof on) < 0)
++ syslog(LOG_WARNING, "setsockopt (TCP_NOPUSH): %m");
+ #endif
+
+ return (fdopen(s, mode));
diff --git a/ftp/wu-ftpd/files/patch-ai b/ftp/wu-ftpd/files/patch-ai
new file mode 100644
index 00000000000..0dc7c97dcdc
--- /dev/null
+++ b/ftp/wu-ftpd/files/patch-ai
@@ -0,0 +1,73 @@
+*** config.h Fri Apr 1 11:03:59 1994
+--- config.h Sat Oct 7 10:09:48 1995
+***************
+*** 30,35 ****
+--- 30,43 ----
+ #define LOG_FAILED
+
+ /*
++ * log login attempts that fail because of class connection
++ * limits. Busy servers may want to prevent this logging
++ * since it can fill up the log file and put a high load on
++ * syslog.
++ */
++ #define LOG_TOOMANY
++
++ /*
+ * allow use of private file. (for site group and site gpass)
+ */
+
+*** src/access.c Sat Oct 7 07:52:31 1995
+--- src/access.c Sat Oct 7 10:10:04 1995
+***************
+*** 803,810 ****
+--- 803,812 ----
+ acl_join(class);
+ return (1);
+ } else {
++ #ifdef LOG_TOOMANY
+ syslog(LOG_NOTICE, "ACCESS DENIED (user limit %d; class %s) TO %s [%s]",
+ limit, class, remotehost, remoteaddr);
++ #endif
+ pr_mesg(msgcode, msgfile);
+ return (-1);
+ }
+*** src/ftpd.c Sat Oct 7 07:52:30 1995
+--- src/ftpd.c Fri Oct 6 23:48:59 1995
+***************
+*** 1435,1441 ****
+ if (dout == NULL)
+ goto done;
+ #ifdef HAVE_ST_BLKSIZE
+! send_data(fin, dout, st.st_blksize);
+ #else
+ send_data(fin, dout, BUFSIZ);
+ #endif
+--- 1435,1441 ----
+ if (dout == NULL)
+ goto done;
+ #ifdef HAVE_ST_BLKSIZE
+! send_data(fin, dout, st.st_blksize*2);
+ #else
+ send_data(fin, dout, BUFSIZ);
+ #endif
+***************
+*** 1718,1723 ****
+--- 1718,1734 ----
+ on = IPTOS_THROUGHPUT;
+ if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *) &on, sizeof(int)) < 0)
+ syslog(LOG_WARNING, "setsockopt (IP_TOS): %m");
++ #endif
++ #ifdef TCP_NOPUSH
++ /*
++ * Turn off push flag to keep sender TCP from sending short packets
++ * at the boundaries of each write(). Should probably do a SO_SNDBUF
++ * to set the send buffer size as well, but that may not be desirable
++ * in heavy-load situations.
++ */
++ on = 1;
++ if (setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, (char *)&on, sizeof on) < 0)
++ syslog(LOG_WARNING, "setsockopt (TCP_NOPUSH): %m");
+ #endif
+
+ return (fdopen(s, mode));