Forum OpenACS Development: Re: cache statistics

11: Re: cache statistics (response to 8)
Posted by Rocael Hernández Rizzardini on

> For handling the file-deliveries, i would recommend the
>background file delivery based on libthread, which does not
>block connection threads.

do you have something working for this?

14: Re: cache statistics (response to 11)
Posted by Gustaf Neumann on
Sure, we use this in production since more than one year. For example today (no semester yet) we had so far 150.000 file deliveries.

The asynchrounous background delivery requires a small patch (2 changes, one is a backport from naviserver) and the tcl thread library (by zoran). The application code is in XOTcl is only a few lines of code and is included in xotcl-core (bgdelivery-procs.tcl).

One needs the following patch to aolserver 4.0.10

with this patch and xotcl-core, you can replace

ns_returnfile 200 $mime_type $filename


ad_returnfile_background 200 $mime_type $filename

e.g. in cr_write_content in acs-content-repository/tcl/revision-procs.tcl
to activate it and to deliver files from the content-repository (file-store) in the background.

The connection thread is only used for permission management, localization of the file and writing the the reply header, the actual delivery of the file is performed via asychronous io without using up many resources. This can handle probably a couple of thousand concurrent file deliveries without running out of resources.

Btw, the streaming variety of the xowiki chat uses the same infrastructure to implement synchronous chats without polling.

That's cool stuff. Neophytos uses this on since at least half a year and is as well very happy with it.

Posted by Andrew Piskorski on
Gustaf, that sounds like an exceedingly useful patch. Did you ask for AOLserver cvs commit on SourceForge so you can add it there?
Posted by Gustaf Neumann on
The patch is now in cvs head of aolserver at sourceforge.
Posted by Jose Agustin Lopez Bueno on

What about this patch on Aolserver 4.5?

Best regards,

Posted by Jose Agustin Lopez Bueno on

Thanks for the patch, Gustaf.
I have already applied it to my installation.