« Back to blog

Node FTP Server - Initial Release

Have done an initial release of my FTP Server in node.js. still a lot of work to do (like maybe some error handling?!) but i have the basic functionality working pretty seamlessly with filezilla client.

It works fine with large files (200MB+) and have managed to push it to 50k+ concurrent logged in connections (all idle - things get a bit hairy when they are all sending and receiving messages).... Seems to use up about 3-4k per active connection on average.


Git Repo is here

It has only been tested against node release 0.1.21 so far.

When i run the included test script, i get the following after 50000 connections:

FTP Return Codes:
"220":50002,
"230":50002,
"257":50002,
"331":50002,

Memory Usage (MB):
"RSS":139,
"VSZ":164,

Connection Info (Connected, Errors, EOF events, Close events, Timeout
events):
"CON":50002,
"ERR":0,
"EOF":0,
"CLO":0,
"TIM":0

feel free to provide some feedback if you have a chance to have a look at it.


NOTE: Will only work in ACTIVE mode (set your FTP client to use active connections). PASSIVE mode only works with a patch to the node code. As far as I know Ryan is adding the functionality to allow retrieval of an assigned ephemeral port in a listen event on the TCP Server, but this is not in the latest node release yet. If you really want to test out Passive mode, you can apply these patches to node release 0.1.21: