Europython: Jeroen Vloothuis - Tramline, big files are funΒΆ

Tags: europython, europython2006, plone

Plone doesn't really like big files. Common solutions: put the files on the disk, either by serving them from apache directly or using some filesystem-folder product. Both aren't ideal.

Tramline is put inbetween apache and plone. Tramline strips out all the file data and extracts that to disk, so plone only gets some small file. When the file is requested, tramline adds it again.

Some advantages: transparent integration, you can develop and test your application without tramline, the only difference is a few extra headers. The performance is high, apache does most of the work. It is secure, as you still have to go through the entire zope/plone security infrastructure: you can't fake the URL and get the file directly from apache. The files are on disk, which makes many people happy.

You have to send two extra http headers to integrate with tramline. tramline_ok upon succesful storage of the rest of the file data inside plone. Secondly, tramline_file when you serve a file that tramline has to insert into the flow.

Tramline needs a bit of apache configuration, as it integrates through mod_python. Some benchmarks: zope managed 26 MB/sec, tramline managed 92 MB/sec, just on his local machine.

Tramline is easy to set up, it integrates nicely and it scales like apache.

In response to a question: it cannot handle, for instance, archetype's image scaling yet. That needs the file in the ZODB.

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):