ANN: releaed pyftpdlib 0.7.0

74 views
Skip to first unread message

Giampaolo Rodolà

unread,
Jan 25, 2012, 2:55:02 PM1/25/12
to pyft...@googlegroups.com
Hi there guys, 
After over 1 year since the previous version, I'm pleased to announce new pytftpdlib 0.7.0 release which is available here: 

Other than fixing some serious FTPS bugs, this new version introduces massive speedup improvements.

=== sendfile() ===

We finally introduced sendfile(2) system call usage. sendfile(2) provides a "zero-copy" way of copying data from one file descriptor to another (a socket). The phrase "zero-copy" refers to the fact that all of the copying of data between the two descriptors is done entirely by the kernel, with no copying of data into userspace buffers, resuting in file transfers (RETR, hence from server to client) being from 2x to 3x faster.

A simple benchmark:

pyftpdlib 0.6.0:    693.41 MB/sec 
pyftpdlib 0.7.0:   1694.14 MB/sec
proftpd 1.3.4rc2:  1313.77 MB/sec
vsftpd 2.3.2:      1505.18 MB/sec

In order to use sendfile(2) you'll have to install pysendfile module first (UNIX only):

== Faster scheduler ==

The internal scheduler, governed by CallLater and CallEvery classes, has been rewritten from scratch and it is an order of magnitue faster, especially for operations like cancel() which are involved when clients are disconnected (hence invoked very often). Some benchmarks:

schedule:   +0.5x
reschedule: +1.7x
cancel:     +477x (with 1 milion scheduled functions)
run:        +8x

Also, a single scheduled function now consumes 1/3 of the memory thanks to __slots__ usage. 

== SITE CHMOD ==

This new version supports SITE CHMOD command, meaning the client is able to change file mode bits by issuing "SITE CHMOD path mode" command. The authorizer now accepts a new "M" permission bit, which, when specified, enables SITE CHMOD usage:

>>> authorizer = DummyAuthorizer()
>>> authorizer.add_user('user', 'password', '/home/user', perm='elradfmwM')

== Other improvements ==

 * on_failed_login() callback: this is called when user provides wrong credentials.
 
 * CallEvery class: same as CallLater, but keeps calling a function every X seconds.
 
 


A complete list of changes including enhancements and bug fixes is available here: 
It also includes instructions on how to update your code to make it compatible with this new version.


Use the mailing list in case you experience some problem with the new version or you just want to send feedbacks or suggestions. 

In case you think you found a bug, please add an entry in the bug tracker: 


That's all folks. 
I hope you'll enjoy this new version, 

Giampaolo Rodola'

Yan Raber

unread,
Jan 26, 2012, 4:40:16 AM1/26/12
to pyft...@googlegroups.com
Bravo bravo bravo!


2012/1/25 Giampaolo Rodolà <g.ro...@gmail.com>
--
You received this message because you are subscribed to the "Python FTP server library" project group:
http://code.google.com/p/pyftpdlib/
To post to this group, send email to pyft...@googlegroups.com
To unsubscribe from this group, send email to pyftpdlib-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/pyftpdlib

Thomas Weholt

unread,
Jan 26, 2012, 4:57:41 AM1/26/12
to pyft...@googlegroups.com
Yey! I'm looking forward to using pyftpdlib in my current project. The
addition of the sendfile feature is really exciting for me because I'm
going to transfer alot of data. Thanks!!

PS! Do you have any example on how to serve a virtual filesystem using
pyftpdlib?

Regards,
Thomas Weholt

--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

Giampaolo Rodolà

unread,
Jan 26, 2012, 5:59:54 AM1/26/12
to pyft...@googlegroups.com
Il 26 gennaio 2012 10:57, Thomas Weholt <thomas...@gmail.com> ha scritto:
> Yey! I'm looking forward to using pyftpdlib in my current project. The
> addition of the sendfile feature is really exciting for me because I'm
> going to transfer alot of data. Thanks!!
>
> PS! Do you have any example on how to serve a virtual filesystem using
> pyftpdlib?

AbstractedFS class has been overridden in various ways in different projects.
I can't remember which ones exactly but you might want to take a look at:
http://code.google.com/p/pyftpdlib/wiki/Adoptions

Also:
https://groups.google.com/forum/#!searchin/pyftpdlib/database/pyftpdlib/Cmcriwoybzw/oLLtmuhxgFEJ
https://groups.google.com/forum/#!searchin/pyftpdlib/database/pyftpdlib/buePrncaNT4/0D2gsnvGR9kJ

Basically what you need to do is overriding the original methods such
as listdir(), mkdir() etc. in order to change the default logic (db
backends are a typical example).
Just keep in mind that sendfile() is going to work with regular file
objects only (the instance returned by open() builtin).
It's not gonna work, for example, with a StringIO object:
http://code.google.com/p/pyftpdlib/wiki/FAQ#sendfile()


Regards,

--- Giampaolo

Reply all
Reply to author
Forward
0 new messages