home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / doc / administrators / tuning < prev    next >
Encoding:
Text File  |  1990-02-28  |  11.0 KB  |  259 lines

  1. .\".AU
  2. .\"Douglas P. Kingston III
  3. .\".AI
  4. .\"Ballistic Research Laboratory
  5. .\"USA AMCCOM
  6. .\"Aberdeen Proving Ground, Maryland.  21005
  7. .\"(301) 278-6651
  8. .bp
  9. .NH
  10. Tuning \*M
  11. .NH 2
  12. Introduction
  13. .PP
  14. Mail systems can vary greatly in the amount of traffic they carry
  15. and the communities they serve.  This variety of environments and
  16. loads cannot be properly served without appropriate tuning of the
  17. mailsystem to the environment it must serve.
  18. Tuning can take many forms, but the most common is adjusting
  19. the number and type of
  20. .I deliver
  21. daemons you have servicing the mail queues.
  22. Another common technique is to create additional mail queues
  23. which may serve a special subset of a larger queue to enable
  24. processing of that subset at a higher or lower priority.
  25. .NH 2
  26. Multiple Queues and Channels
  27. .PP
  28. One common method to improve the performance of \*M is to
  29. partition the mail queue into multiple directories.
  30. Generally this is done such that each channel has its own
  31. queue.
  32. The advantage is that when the daemon is working on a given
  33. channel, it need only examine messages which it knows are for that
  34. channel (by virtue of being in the queue directory for that channel).
  35. It is possible to have multiple channels operating from a single
  36. queue, and this might be advantageous if you had a very large number
  37. of channels each with a very small amount of traffic, but this is
  38. unlikely and probably  only worth thinking about when the number
  39. of channels approaches 100 or more.
  40. .PP
  41. Adding channels which cover a subset of hosts accessible by another
  42. channel is a good technique for increasing throughput and
  43. reduce delivery latency.
  44. .PP
  45. A good example of this is the BRLNET channel used at BRL.
  46. All BRL hosts are on the ARPANET (MILNET), and as such could
  47. be queued into the smtp channel for delivery.  If this were
  48. done, the BRLNET messages would be mixed up with the hundreds
  49. of messages pending for tardy ARPANET sites.  In addition, the
  50. delivery latency would rise dramatically since you would have to
  51. wade through all the tardy messages on each pass over the queue.
  52. To provide better service to the directly connected hosts, we
  53. defined a BRLNET channel, with its own queue, and re-used the
  54. smtp program.
  55. This channel is defined before the SMTP channel so when a message
  56. is queued for a BRL host, the \fIsubmit\fR program
  57. finds the BRL host name first in the BRLNET channel table and
  58. therefore queues it into the BRLNET channel.
  59. The \fIdeliver\fR servicing the BRLNET channel services only
  60. the BRLNET channel and a couple of lightly loaded channels
  61. like the local and list channels.  This means the the BRLNET channel
  62. gets a high level of service and because of our high-speed local
  63. area networks, the delivery latency is quite small.
  64. .PP
  65. Another use for separate channels is for tardy hosts.  At times
  66. there have been several hosts tardy over a long period of time (weeks).
  67. Rather than have them fill up the regular mail queues, we created
  68. a special channel with only these ``turkey'' hosts and placed
  69. this channel ahead of the smtp channel in the configuration file.
  70. This caused mail for the turkey hosts to be queued into this channel
  71. rather than the smtp channel.
  72. The turkey channel had its \fIdeliver\fR run less often than normal.
  73. .NH 2
  74. Multiple Daemons
  75. .PP
  76. It is possible to run multiple invocations of
  77. the \fIdeliver\fR daemon.  There are three advantages to multiple
  78. daemons.  The first is increased throughput.  Although the mail
  79. processes do use a considerable amount of cpu time, they spend a
  80. large amount of time waiting while actually delivering mail so
  81. it is possible for two \fIdeliver\fR daemons to deliver close to twice
  82. as much mail in the same period as one daemon.
  83. Second, with more than one deliver, the delivery latency will be reduced
  84. since with more daemons, the chances that one will find your message
  85. in the same amount of time are twice as good.
  86. Third, multiple daemons servicing the same channel provide redundant
  87. service.  If one daemon should die off, the remaining delivers on that
  88. channel will continue to deliver, although providing a reduced level
  89. of service.
  90. .NH 2
  91. Single Daemon
  92. .PP
  93. For machines at your site which aren't very busy,
  94. you may want to run with just a single daemon.
  95. The advantage here is that you have fewer background processes
  96. meaning less swap space use,
  97. and lower process scheduling overhead.
  98. .PP
  99. There are two ways of doing this.
  100. One is to, in your startup script, to list all the channels like so:
  101. .sp
  102. .nf
  103. .RS
  104. .nf
  105. deliver \-b \-clocal,list,other1,other2,...
  106. .fi
  107. .RE
  108. .fi
  109. .LP
  110. Or a new feature which allows deliver to automatically find all
  111. non-passive channels, just `deliver -b'.
  112. .NH 2
  113. Tailoring Delivery Characteristics
  114. .PP
  115. There are numerous options that can be used to control the behavior
  116. of deliver daemons.  The most common is
  117. `\-c\fIchannel,channel,channel\fR' which sets which channels the
  118. deliver will attempt to process.
  119. One might have one daemon processing local, uucp, and localnet
  120. mail and two other daemons just processing smtp
  121. mail if you were a large site relaying a lot of mail to the
  122. Arpanet.
  123. The configuration used on the main
  124. mail host at BRL is as follows:
  125. .sp
  126. .nf
  127. .RS
  128. .nf
  129. deliver \-L/usr/mmdf/log/deliver1 \-b \-l15 \-clocal,brlnet,list,uucp,bb
  130. deliver \-L/usr/mmdf/log/deliver2 \-b \-t24 \-csmtp
  131. deliver \-L/usr/mmdf/log/deliver3 \-b \-t48 \-csmtp
  132. deliver \-L/usr/mmdf/log/deliver4 \-b \-csmtp
  133. deliver \-b \-l15 \-s \-T300 \-cucl
  134. deliver \-b \-l15 \-m300 \-o48 \-cucl-dial
  135. .fi
  136. .RE
  137. .fi
  138. .PP
  139. This is a very good example because it demonstrates the use of almost all the
  140. different delivery tuning mechanisms.
  141. There are seven different queues.
  142. There are six separate \fIdeliver\fR daemons.
  143. The last two \fIdeliver\fR daemons share the same queue.
  144. The queues can be characterized as follows:
  145. .sp
  146. .nf
  147. .DS
  148. .TS
  149. l l .
  150. local    \- Local mail delivery, light volume, fast
  151. brlnet    \- Mail to other BRL hosts via LANs, medium volume, some backup
  152. list    \- List processor, light volume, fast
  153. uucp    \- UUCP channel, light volume, fast
  154. bb    \- BBoards channel, light volume, fast
  155. smtp    \- SMTP to Arpanet, heavy volume, large queue backups
  156. ucl    \- SMTP to UCL-CS only, heavy volume, occasional large backups
  157. .TE
  158. .DE
  159. .sp
  160. .fi
  161. The first five are grouped together under one deliver daemon,
  162. with the only major user being the BRLNET channel.  Since
  163. the other channels create an insignificant load, the BRLNET
  164. hosts get an essentially dedicated \fIdeliver\fR daemon.
  165. The smtp channel has so much volume, and spends so much time
  166. waiting for read and writes across the country, that we have three
  167. daemons processing this channel.  The ucl channel
  168. was created to handle all the mail headed to one host, UCL-CS,
  169. since we send them a considerable volume of mail, and occasionally
  170. the satellite has a bad day, and the mail backs up.  We have
  171. had over a thousand messages backed up for this host on more
  172. than one occasion.  The first time this happened, it really slowed
  173. down the smtp delivery.  Now when UCL-CS
  174. is tardy, they hurt no one.  As an example, an alternate delivery
  175. channel for UCL-CS using PhoneNet is shown.  This channel would only
  176. process mail during extended satellite outages.
  177. .NH 2
  178. Dead Host Cache Time-to-live
  179. .PP
  180. When a host is discovered to be dead or not responding, it is
  181. marked ``dead'' by the \fIdeliver\fR daemon.  All further addresses
  182. for that host in the current message or subsequent messages are
  183. skipped until the time-to-live of the ``dead host'' record has
  184. been reached.  The time-to-live is usually defaulted to 2 hours.
  185. The time-to-live can be changed by using the \-l\fIminutes\fR
  186. flag on the \fIdeliver\fR command line.
  187. For example, you will note that on the first \fIdeliver\fR daemon
  188. in the example, the time-to-live is set to 15 minutes since
  189. we do not expect BRLNET hosts to spend much time down and we
  190. want the \fIdeliver\fR daemon to quickly notice when a BRLNET host comes
  191. back on line.
  192. .NH 2
  193. Recent Message Selection
  194. .PP
  195. One of the properties of sending to hundreds of hosts is that if a host
  196. is down for more than a day or two, it is likely to be down considerably
  197. longer.  It is wasteful to have all the daemons constantly working over
  198. all the old messages when the chance of a machine reappearing are relatively
  199. small compared to the chances that a machine down only 4 hours
  200. will reappear.  The \-t\fIhours\fR switch allows us to force the daemon
  201. to consider only messages that were queued in the past \fIhours\fR hours.
  202. In other words, we force the daemon to concentrate on delivering the
  203. recent messages, which have a higher likelihood of delivery.
  204. One daemon looking after the dregs is enough.
  205. You should only use this if you have at least one daemon that does not
  206. have the \-t flag, processing the same queue.
  207. In the example above you can see the \-t flag is being used on both
  208. the second and third \fIdeliver\fR daemons which both service
  209. the largest channel (smtp).  The third daemon is not restricted
  210. with a \-t.
  211. .NH 2
  212. Old Message Selection
  213. .PP
  214. Sometimes it is nice to be able to select an alternate delivery path if a
  215. message has been queued for a long time.  You might have two delivery paths,
  216. say SMTP and PhoneNet, to a certain destination host.  
  217. If messages to that host can't be delivered
  218. for a day or two with SMTP, you might decide to use PhoneNet.  
  219. The -o\fIhours\fR
  220. switch allows you to force the daemon to consider only mail that has
  221. been in the queue over \fIhours\fR hours.  In our example above, the two
  222. ucl \fIdeliver\fR daemons are such a pair.  Both the ucl and the ucl-dial
  223. channels use the same queue but the ucl-dial channel is only used when 
  224. the ucl channel can't get through for two days.
  225. .NH 2
  226. Daemon Sleep Time
  227. .PP
  228. There are certain channels that you wish to run in the background
  229. but for which you do not wish to attempt delivery
  230. as often as the default settings would try.
  231. The \-T\fIseconds\fR switch changes the amount of time in seconds
  232. the daemon will sleep between attempts to deliver messages.
  233. In our example above, we have used this switch on the ucl channel.
  234. This is generally a low-priority mail queue and we are not concerned
  235. that we wait an extra 10 or 20 minutes to discover that the host
  236. has been down, since when it goes down, it is usually down for hours
  237. or days.
  238. The time when this really pays off is when the host is down and mail
  239. has backed up.
  240. When this happens, each time the daemon wakes up, the daemon examines every
  241. address and then decides to skip it because the host is down.   
  242. Occasionally the daemon
  243. will retry the connection (if the time-to-live has expired) but it spends most
  244. of its time not delivering mail.  We simply elect to not attempt as
  245. often, therefore wasting less time.
  246. .NH 2
  247. Queue Sort Override
  248. .PP
  249. In normal operation, \fIdeliver\fR will attempt to sort the
  250. queue of messages for each channel in the order they were submitted.
  251. Sorting a large mail queue can be quite expensive and time consuming.
  252. On some channels you don't care in what order the messages are
  253. delivered.  In these cases it is advantageous from an efficiency
  254. standpoint to be able to disable the queue sorting.
  255. The \-s option does just that.  If this option is specified,
  256. the daemon will read the queue and process the messages in the
  257. order they were found.  This will often not be the order in which
  258. they were submitted.
  259.