Debian NSLU2 - Cool applications

This article describes the applications currently running on my Slug. The configuration has been detailed when it has been optimized for the Slug: indeed, the low resources available on the Slug forced me to optimize some parameters so that the Slug can run it! 

1.   TFTP Server: atftpd

    To be able to network boot, I need a TFTP server that serves the boot images. The Slug is perfect to accomplish that task.

apt-get install atftpd

Then we edit the config file, /etc/default/atftpd, I choose not to use inetd.

cat /etc/default/atftpd
USE_INETD=false
OPTIONS="--daemon --port 69 --tftpd-timeout 300 --retry-timeout 5     --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5  /tftpboot"
    We need to create the /tftpboot folder, but it's more detailed over here.

2.   FTP Server: vsftpd

    FTP is the protocol to use for file transfert. apt-get install vsftpd. See my configuration.

3.   NTP Server: ntpd

    To keep the time accurate on my network, I chose to set up a NTP server on the Slug: the Slug keeps synchronized with pool.ntp.org and my local computers synchronize then with the Slug.

 apt-get install ntp. See my configuration 

4.   NFS Server: nfs-kernel-server

    To browse the drives attached to my Slug, I chose to set up a NFS server. 

 apt-get install nfs-kernel-server nfs-common

5.   Web Server: lighttpd + php5

    For my web server, I chose lighttpd because it's light. It supports php5 through cgi server. See my configutation files: lighttpd.conf - php.ini.

6.   Bittorrent client: rtorrent

    rtorrent is THE ultimate bittorrent client. It uses no ressources and gets incredible speeds!I do not understand people using something else to download their torrents (even on desktop pc). apt-get install rtorrent. My ~/.rtorent.rc file.

    One cool this downloading torrents with the Slug, is that the Slug never sleeps :) It means that whereas I often shutdown my laptop, my Slug is always up and ready to download. To achieve running rtorrent and not closing it when you close your ssh window (or shutdown your pc) is to use screen.
screen -dmS torrent. This command creates a screen named "torrent". To connect to that screen issue screen -r torrent. Then launch rtorrent. When you're done looking at rtorrent window, press Ctrl+a+d. You will detach from the "torrent" screen. You can now safely close your ssh window. rtorrent is still running in the "torrent" screen. You can re ssh to the Slug, type screen -r torrent and there you go, you find the rtorrent window still running like you left it!

7.   Proxy cache server: squid

    Squid is a proxy cache server well know for its efficiency. 

 apt-get install squid. squid.conf Take a look at the configuration, as the default configuration will kill your Slug consuming too much resources.

8.   Conclusion

    The Slug is really a particular piece of hardware. Indeed it's been two years now that is runs 24/7, it never crashed. Here are some indication regarding applications performances:

  • TFTP: no problems
  • FTP: excellent speed (depends on current system load)
  • NFS: very stable - I limited it to only 4 processes (depends on current system load)
  • Squid: uses 20% of memory, 5% CPU with 2 clients
  • rtorrent: uses 10% of memory and 1% CPU with 2 torrents
  • lighttpd: long response time but operates. Beware with php that can quickly overload the Slug.
Back to Linksys NSLU2