Filtered by popular tag libthread, 1 - 3 of 3 Postings (
all,
summary)
Created by Gustaf Neumann, last modified by Gustaf Neumann 14 Jan 2010, at 08:15 PM
Libthread is the standard Tcl thread library developed by Zoran Vasiljevic and provides optional functionality for OpenACS. Threads created by the Tcl thread library are executed in an event loop, which makes it easy to send commands to such threads. xotcl-core provides support for the the thread library and uses it for example for background delivery of large files. Also the chat package uses libthread when it is installed. The xotcl-request-monitor depends on libthread.
INSTALLATION:
1. Get and install libthread:
download thread2.6.5 from
http://mesh.dl.sourceforge.net/sourceforge/tcl/thread2.6.5.tar.gz
untar it and go to you platform specific directory (eg. thread2.6.5/unix)
# cd unix
# ../configure --enable-threads \
--prefix=/usr/local/aolserver \
--exec-prefix=/usr/local/aolserver \
--with-aolserver=/usr/local/aolserver
use --prefix --exec-prefix --with-aolserver with the path pointing to the directory, where aolserver4 is installed. The flag --with-aolserver is essential. When multiple Tcls are installed on the system, it is recommended to use the flag pointing to it, like e.g. in --with-tclinclude=/usr/local/src/tcl8.4.16/unix/ --with-tcl=/usr/lib/
make
# check in output if there is following definition: -DNS_AOLSERVER=1
make install
You should now have installed libthread2.6.5.so (check for /usr/local/aolserver/lib/thread2.6.5/libthread2.6.5.so
2) Adjusting config.tcl for libthread service
I would recommed to load libthread 2.6.5 as a "module" from the aolserver config file to avoid a mixup with the plain tcl libthread extension (which is most likely compiled without --with-aolserver)
- open config.tcl (/var/lib/aolserver/${yourservice}/etc/config.tcl)
- look for modules section: ns_section ns/server/${server}/modules
- add libthread to modules section:
ns_param libthread ${homedir}/lib/thread2.6.5/libthread2.6.5.so
restart the aolserver and check the error log, whether libthread2.6.5 was loaded successfully.
svc -t /service/${yourservice}
Created by Gustaf Neumann, last modified by Gustaf Neumann 14 Jan 2010, at 12:59 PM
Package specification Summary for package xotcl-request-monitor
| Description |
This package provides a Request Monitor for OACS applications. It computes performance summary information such as requests/views per seconds, average response time, number of users connected, lists currently active threads, etc. Furthermore it can block overactive users (e.g. automated web-bots mirroring the site, users repeating running queries, etc.). It provides as well some user tracking (such as whos-online) with activity measures, it blocks repeated requests (impatient reloads), tracks switching of IP-adresses from users and provides request tracking per user for the monitored time window. It contains as well overall url statistics with performance measures. Updated for cirumventing handler calls openacs 5.2 for /resources/*.
0.28 provides calles for listing active communities and users active in these communities.
0.30 provides a nice graphical chats (many thanks to Nima) and a new interface to the background thread. In addition, ns_returnfile_background is included;
0.38 using context form xotcl-core
0.39 brings parameterized counter values |
| Maturity |
New Submission or Maturity Unknown |
| This package depends on: |
xotcl-core |
| Packages that depend on xotcl-request-monitor |
None |
Bug Tracker Summary for package xotcl-request-monitor
Code Metrics Summary for package xotcl-request-monitor
| # Tcl Procs |
2
|
| # Tcl Lines |
1256
|
| # Automated Tests |
0
|
| # Stored Procedures |
PG: 0 ORA: 0
|
| # SQL Lines |
PG: 0 ORA: 0
|
| # ADP pages |
10
|
| # ADP lines |
135
|
| # Include pages (xotcl-request-monitor/lib/) |
0
|
| # Documentation pages |
0
|
| # Documentation lines |
0
|
The xotcl--request-monitor depends in xotcl-core and libthread.
Created by Rocael Hernández Rizzardini, last modified by Gustaf Neumann 24 Nov 2008, at 03:23 PM
In order to speed up file-deliveries, one can use the background delivery methods provided by xotcl-core. The main advantage is that with background delivery the costly connection threads are just used for permission checking and locating the file, and the time-consuming spooling of the file to the client is implemented in an asynchronous background delivery thread. Therefore, connection thread are not blocked, it is possible to spool simultaneously several hundred (thousand?) files with only a few connection threads configured.
We use this in production since several years. For example today (no semester yet) we had so far 150.000 file deliveries by background delivery.
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
The patch is already included in the current head version of aolserver 4.5 and in naviserver.
With this patch and xotcl-core, one can replace
ns_returnfile 200 $mime_type $filename
by
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.
Check the files that has been served since the last reboot of your aolserver using this method from the developer support shell:
bgdelivery do set delivery_count
Original thread:
http://openacs.org/forums/message-view?message_id=482221