Forum OpenACS Development: Bad HTML + Notifications

Collapse
Posted by Michael Steigman on
We've just run into a situation where some bad HTML took our server down. The bad HTML (unclosed tags) caused the text/html conversion proc called in acs_mail_lite::send_immediately to return an error. Although the error is caught in the sweeper (acs-mail-lite-procs.tcl), the memory consumed in the scheduled thread is not released. Since the message wasn't sent, the sweeper tries to process it again and again. In our case, the outgoing message contained batched notification for many edits on a handful of large wiki pages which totaled about 8mb. With the sweeper running every minute, you can see how this can get out of hand quickly.

We've identified the source of the bad HTML and, locally, we've modified the sweeper to leave a bad message locked so it won't be processed again. This isn't a proper long-term solution, though. Rather than silently deleting the message or abusing the semantics of the locking_server column, I suggest we generalize the "locking_server" column into a status column that can be 'locked', or 'failed'. Thoughts?

Collapse
Posted by Gustaf Neumann on
it would certainly make sense to handle failing queued requests in a better manner, flagging failed requests, options for the swa to redo or flush, ... this would be in general useful for all queues. Strangely enough, this happens rather seldom, so it seems nobody has implemented a more general solution (e.g. adding a column "state").

a few hints that might improve the situation for you:

* xowiki contains an option to use tidy for cleaning up the content.

* NaviServer has a config parameter "schedsperthread" that defines a maximum number of scheduled procs per worker thread, leading to a cleanup by terminating the threads running the scheduled procs regularly.

-gustaf

Collapse
Posted by Michael Steigman on
Thanks for the response, Gustaf. It is strange it doesn't happen more often. I'll change make the changes on HEAD. I checked and we must be a bit behind in terms of xowiki versions as we don't have the tidy option. I'll look into upgrading.

Regarding Naviserver, is it at the point yet where it can be a drop-in replacement for Aolserver?

Collapse
Posted by Gustaf Neumann on
yes, the version of naviserver in bitbucket https://bitbucket.org/naviserver/naviserver is the version we use in production. With the config file openacs-config.tcl (on bitbucket) it works pretty much out of the box with OpenACS. We switched to naviserver about two years ago and developed a small layer for the openacs. With this and a recent version of xotcl-core one is also ready to use naviserver with XOTcl 2/NX (http://next-scripting.org/)

Below are some long-term statics from our production system, where one can see how the resources went down and the performance improved. All data is from the same hardware. In the the last two years, the number of views/day more than doubled, while the overall response time was cut to less than a third (even though the database size went up, we have added recently much more rather complex queries for workflows, plagiarism checking, lecture casts, etc.). We have now more than 120.000 learning resources, more than 5.000 courses per year. Performance-wise, XOTcl 2/nx helped a lot, but finally, it is hard to say, how much each piece contributes. Due to the reduced resource consumption, our next production machine will be significantly cheaper than the previous one (will be in use in oct).

http://www.openacs.org/xowiki/file/naviserver-nx.png

-gustaf

Collapse
Posted by Dario Roig on
Hello. In the University of Valencia we are trying to install naviserver with openacs (5.3). We are interested about the "small layer for the openacs". Can we find this code in de CVS?
On the other hand, we have not found the nsldap module.

Thanks to share our experiences

Collapse
Posted by Gustaf Neumann on
the mentioned layer is in part in the naviserver distribution (aolserver-openacs.tcl) and part in OpenACS (guarded by

if {[ns_info name] eq "NaviServer"}

). See e.g. acs-tcl/tcl/utilities-procs.tcl. the naviserver support is quite a long time in OpenACS, but was improved over the years. i am not sure about the state of OpenACS 5.3, my recommendation is to upgrade to a more recent version.

In other words, for the layer, there is nothing extra to install.

Concerning nsldap: A few days ago, I have added a nsldap module adjusted to the C-api of naviserver to the bitbucket repository.

Best regards

-gustaf neumann

Collapse
Posted by Claudio Pasolini on
Hi Gustaf,

I'd like to test NaviServer + PG 9.2 + OpenACS Head but I'm not sure how to compile tdom and libthread that usually take a --with-aolserver argument.

Should I simply omit that argument? And what about xotcl, normally built with 'make install-aol'?

Thanks in advance,

Claudio

Collapse
Posted by Jim Lynch on
the tdom module is completely in and for tcl now,,,

  • so, untar it
  • cd in there,
  • cd to unix, then...
  • CC=compilerYouBuiltTCLWith ../configure --enable-threads --disable-tdomalloc --prefix=/path/to/tcl/install --with-tcl=/path/to/tcl/install/lib

    note that compilerYouBuiltTCLWith should really be the compiler you're building everything with, and so if you built without any CC= in the configure step you can leave it out of everything else, and

    /path/to/tcl/install would be the value of --prefix= when you ran the tcl ./configure.

the --prefix will install tdom so it's a sibling of the other tcl modules.

Collapse
Posted by Jim Lynch on
more...

I'm using tcl-8.5 and tdom-0.8.2

Collapse
Posted by Jim Lynch on
even more...

xotcl is also in and for tcl; soemthing happened when aolserver4 cane out,,, it allowed regularly built tcl modules to be included by aolserver without special/weird actions or syntaxes for doing it. the consequence of that is nothing needs to be --with-aolserver any more.

./configure --with-tcl=/path/to/tcl/install/lib --prefix=/path/to/tcl/install --enable-threads --without-aolserver3

which will also make the xotcl module, when installed, a sibling of the other tcl modules.

Collapse
Posted by Gustaf Neumann on
Use --prefix=/usr/local/ns for everything, that keeps your aolserver installation untouched; see below. As pg driver, use nsdbpg from bitbucket (http://bitbucket.org/naviserver/)

Concerning XOTcl: i would recommend to use XOTcl 2.*, https://next-scripting.org/; a configure --with-tcl=/usr/local/ns/lib/ should again be sufficient, no "make install-aol" needed. Same is true for for XOTcl 1.6.*, but i have not tested this for a while. Don't install in the same tree xotcl 1.* and xotcl 2.*, since the the 2.* versions are still in beta, and a "plain package require" prefers the non-beta over the beta version.

all the best
-gustaf

cd /usr/local/src/tcl8.5.12/unix
./configure --prefix=/usr/local/ns --enable-threads --enable-symbols
make
make install

cd /usr/local/src/tDOM-0.8.3/unix
../configure --prefix=/usr/local/ns --with-tcl=/usr/local/ns/lib 
make 
make install

cd /usr/local/src/thread/unix
../configure --enable-threads --prefix=/usr/local/ns --exec-prefix=/usr/local/ns --with-tcl=/usr/local/ns/lib --with-aolserver=/usr/local/ns
make 
make install

cd /usr/local/src/xotcl-1.6.7
./configure --with-tcl=/usr/local/ns/lib/
make
make install
Collapse
Posted by Claudio Pasolini on
The installation went well.

Thank you very much for the suggestions.

Collapse
Posted by Jim Lynch on
you might want to try openacs-5.7, postgres-9.1, tcl-8.5.x and aolserver-4.5.1 or 2.

Openacs won't use that one new feature of tcl (the '(*)' thing) for awhile; the tcl peeps say tcl 8.4 is hanging and I'm sure pg wants to put 8.anything to bed.

I have an openacs-5.7 running on pg-8.3 in staging, it's looking good; I'll be moving the data model to 9.1 to try it out shortly.