%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %deffont "normal" xfont "times" %deffont "typewriter" xfont "courier new-r" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %default 1 area 90 90, leftfill, size 2, fore "black", back "white" %default 2 size 7, vgap 10, prefix " " %default 3 size 2, bar "gray70", vgap 10 %default 4 size 5, fore "black", vgap 30, prefix " " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %tab 1 size 5, vgap 40, prefix " ", icon box "black" 40 %tab 2 size 4, vgap 40, prefix " ", icon arc "black" 50 %tab 3 size 3, vgap 40, prefix " ", icon delta3 "black" 40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Agenda %size 4 Introduction Architecture of AFD Compiling Setting up AFD Graphical User Interface Configuration by examples Evaluating Log Data %size 6 Performance and other considerations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Performance and other considerations What one needs to consider when AFD runs on a NFS filesystem Things to consider when configuring the FTP server Let AFD only move files and NOT copy them Some performance tweaks AFD in an HA environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Considerations when AFD runs on a NFS filesystem Remember the internal directory structure of AFD and the what happens internally when it sends a file. Make sure that the files directory (and maybe also the archive directory) is also located on the NFS mount. %font "typewriter", size 3 afd@idefix:~$ ls -l $AFD_WORK_DIR total 28 lrwxrwxrwx 1 afd afd 17 2011-04-07 07:12 archive -> /mnt/nfs/archive drwxr-xr-x 2 afd afd 4096 2011-05-09 09:00 bin drwxr-xr-x 2 afd afd 4096 2012-09-17 11:09 etc drwxrwxr-x 2 afd afd 4096 2012-09-17 11:09 fifodir lrwxrwxrwx 1 afd afd 15 2011-04-07 07:12 files -> /mnt/nfs/files drwxrwxr-x 2 afd afd 4096 2012-09-28 00:00 log drwxrwxr-x 2 afd afd 12288 2012-06-27 11:23 messages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Considerations when AFD runs on a NFS filesystem (cont.) When you monitor directories on an NFS filesystem and you have problems that AFD does not pick up files, use the [dir options] 'force reread'. NFS sometimes does not update the date of the directory correctly. 'force reread' will force AFD to read the content of the directory every time during each scan. Otherwise it would just check the date of the directory to see if anything changes. For performance and stability reasons it is not good if fifodir is on an NFS mount. Better to use tmpfs or ram disk for the fifodir. This has the disadvantage that you will loose some statistical information after a system crash, but you will not loose any data. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Things to consider when configuring the FTP server A good and secure FTP server is vsftpd. Do not run the FTP server via xinetd, it is very slow. Also, disable logging if you do not need it. Logging is very expansive on a system that receives lots of files. Use only FTP accounts that have no shell. The password is transmitted in clear text via internet or RMDCN! chroot the FTP account so that the FTP user cannot explore your server. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Let AFD only move files and NOT copy them As mentioned earlier always let AFD run as closely as possible where the actual data is produced. Ensure that at least that the files directory is in the same filesystem where it's input directories are. Use soft links. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Some performance tweaks Compile in only that what you need. Use the configure option --enable-compiler-optimizations On linux (as of kernel 2.6.17) use --enable-splice_support. This avoids copying data from kernel space to user space when copying files locally. The copying only happens in kernel space. For network connections use --enable-sendfile_support. Again the kernel does not need to copy any data to user space for any sockets. Only tested on linux. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Some performance tweaks (continued) Do NOT do the following: %font "typewriter", size 2.5 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out1 file://afd@local/data/out2 sftp://afd@local/data/out3 ftp://ftponly:secret@local/data/out4 [options] exec -d bzip2 -9 %s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Some performance tweaks (continued) Rather do it as follows: %font "typewriter", size 2 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] *.bz2 [destination] [recipient] file://afd@local/data/in [options] exec -d bzip2 -9 %s lock OFF [files] !*.bz2 * [destination] [recipient] file://afd@local/data/out1 file://afd@local/data/out2 sftp://afd@local/data/out3 ftp://ftponly:secret@local/data/out4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Some performance tweaks (continued) Mount your filesystem with the noatime flag! Most newer linux systems have relatime set automatically. But better is noatime. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page AFD in an HA environment First thing you need to decide if you really need a cluster with a shared filesystem/disk. Arguments against it are higher complexity and single point of failure. If you decide that you need it, have a look at DRBD (http://www.drbd.org/). For cluster software have a look at heartbeat (http://www.linux-ha.org). Note, that you do not need pacemaker (keeps your applications running). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page AFD in an HA environment (cont.) If you use heartbeat or pacemaker there is a script in the AFD source package that does all the necessary checks and starts/stops AFD during a switch over. The script can be found in the directory script and is also just called afd. Since this script is also used for starting AFD when system boots, you have to rename this to afdha to activate it's HA features. In the case of heartbeat you would just need to issue the following command: %font "typewriter", size 3.5 cp scripts/afd /etc/ha.d/resource.d/afdha %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page %nodefault %center, size 7, fore "black", back "white", vgap 20 Questions? %pause THANK YOU! %pause %size 4 Please contact me if you have questions, comments or criticism! %size 5 Holger.Kiehl@dwd.de