[AOLSERVER] Is ns_info threads safe to use?

7 views
Skip to first unread message

Sep Ng

unread,
May 31, 2009, 7:53:20 PM5/31/09
to AOLS...@listserv.aol.com
I'm handling aolserver 4.0.10 and yeah, I know it's kind of old. If
I'm not mistaken, ns_info threads was not totally thread safe in that
version and it caused quite a few crashes here. I think I've managed
to get that number of crashing down a bit with mutex and a bit of
aolserver 4.5 code, but it still does happen. I'm wondering though if
ns_info threads was meant to be written as a proc for diagnosing
AOLserver or if it's safe to use to periodically check AOLserver for
running threads.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Jim Davidson

unread,
Jun 1, 2009, 12:03:00 PM6/1/09
to AOLS...@listserv.aol.com
Hi,

The code for "ns_info threads" looks about the same in 4.0 and 4.5 and
it doesn't look super safe. It does have a lock around walking the
list of threads but there are place where it copies data from strings
which may be changing. And, like "ns_server active", it's really
designed for live diag work, not so much as a background health check.

-Jim

Sep Ng

unread,
Jun 1, 2009, 1:04:27 PM6/1/09
to AOLS...@listserv.aol.com
Hi Jim!

Thanks for the reply, Jim. I sort of felt that way too about ns_info
threads. Is there a way in AOLserver to do live monitoring on
threads? We're sort of hoping to get info on what thread ids are
running as of the moment on aolserver.


On Jun 2, 12:03 am, Jim Davidson <jgdavid...@MAC.COM> wrote:
> Hi,
>
> The code for "ns_info threads" looks about the same in 4.0 and 4.5 and
> it doesn't look super safe. It does have a lock around walking the
> list of threads but there are place where it copies data from strings
> which may be changing. And, like "ns_server active", it's really
> designed for live diag work, not so much as a background health check.
>
> -Jim
>
> On May 31, 2009, at 7:53 PM, Sep Ng wrote:
>
>
>
> > I'm handling aolserver 4.0.10 and yeah, I know it's kind of old. If
> > I'm not mistaken, ns_info threads was not totally thread safe in that
> > version and it caused quite a few crashes here. I think I've managed
> > to get that number of crashing down a bit with mutex and a bit of
> > aolserver 4.5 code, but it still does happen. I'm wondering though if
> > ns_info threads was meant to be written as a proc for diagnosing
> > AOLserver or if it's safe to use to periodically check AOLserver for
> > running threads.
>
> > --

> > AOLserver -http://www.aolserver.com/
>
> > To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com


> > > with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> > Subject: field of your email blank.
>
> --

> AOLserver -http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the

Gustaf Neumann

unread,
Jun 2, 2009, 3:42:33 AM6/2/09
to AOLS...@listserv.aol.com
Sep Ng schrieb:

> Is there a way in AOLserver to do live monitoring on
> threads? We're sort of hoping to get info on what thread ids are
> running as of the moment on aolserver.
>
The xotcl-request-monitor watches running requests,
essentially via defining filters/traces for requsts and
using a monitor thread for keeping track of the
"starts" and "ends" of requests. If there are "starts"
recorded without "ends", it knows these requests are still
running in some threads. This approach does not depened
on ns_info, we use it on all our production sites.

Originally i had one version for pure aolserver and one for
OpenACS; since a while i just work on the OpenACS version
(which is available via the public cvs repository of
OpenACS).

best regards
-gustaf neumann

Sep Ng

unread,
Jun 2, 2009, 4:52:34 AM6/2/09
to AOLS...@listserv.aol.com
Hi Gustav!

Thanks for the info. I'm afraid xotcl-request-monitor may not be good
enough if I do not have the thread ids, although I guess I could
rewrite it to work with what xotcl-request-monitor provides.

I did not know of one such monitoring page on OpenACS. I will take a
look and see what I can find.

On Jun 2, 3:42 pm, Gustaf Neumann <neum...@WU.AC.AT> wrote:
> Sep Ng schrieb:> Is there a way in AOLserver to do live monitoring on
> > threads? We're sort of hoping to get info on what thread ids are
> > running as of the moment on aolserver.
>
> The xotcl-request-monitor watches running requests,
> essentially via defining filters/traces for requsts and
> using a monitor thread for keeping track of the
> "starts" and "ends" of requests. If there are "starts"
> recorded without "ends", it knows these requests are still
> running in some threads. This approach does not depened
> on ns_info, we use it on all our production sites.
>
> Originally i had one version for pure aolserver and one for
> OpenACS; since a while i just work on the OpenACS version
> (which is available via the public cvs repository of
> OpenACS).
>
> best regards
> -gustaf neumann
>
> --

> AOLserver -http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <lists...@listserv.aol.com> with the

Gustaf Neumann

unread,
Jun 2, 2009, 6:12:32 AM6/2/09
to AOLS...@listserv.aol.com
It certainly depends on what your application needs.
There is no principal problem obtaining the thread id
(eg. ns_thread id, ::thread::id). One could either
use the sketched approach and simply record whatever
the application needs, or ffone can to extend the
xotcl-request monitor to track this information as well.

just to get the information about running connection
threads from the xotcl-request-monitor, use
"throttle running".

best regards
-gustaf neumann

Sep Ng schrieb:

Tom Jackson

unread,
Jun 2, 2009, 7:37:23 PM6/2/09
to AOLS...@listserv.aol.com
This is an interesting topic, but I can't think of anything to be gained
from a list of threads. Who cares that a thread exists?

But if you are just concerned with threads, you can use ns_pools. All
worker threads in AOLserver are in some named thread "pool". If you
don't use threadpools, all requests, no matter how many virtual servers
you use are handled by the "default" threadpool. A query using ns_pools
can give you a current thread count.

Also you should know that every ns_log (error log) line has information
about the threadpool and the thread id and every error log has the
process id "dot" thread id just after the timestamp. If you wrote a
script to examine the last part of the log file, you could discover
which threads were active.

Personally I would abandon the use of a list of "living" threads as a
measure of anything. When AOLserver goes dark threads usually don't go
away.

tom jackson

Sep Ng

unread,
Jun 2, 2009, 9:28:02 PM6/2/09
to AOLS...@listserv.aol.com
Hello everyone,

I would like to say first of all I appreciate all the thought and
ideas you've brought to the table. What I hope to achieve is to be
able produce a rudimentary load management. I will take a look at
ns_pools and see if I can lift anything from it. Tom, you are right
that AOLserver puts the thread id on the logs and maybe it is worth a
look.

Gahan, Mike

unread,
Jun 3, 2009, 5:16:28 AM6/3/09
to AOLS...@listserv.aol.com

Hi all,

Where is the AOLserver online doc these days? I was using
http://dev.aolserver.com/wiki/Tcl_API but that is erroring now.


Mike Gahan

Architect / Analyst / Developer / Fixer

AOL (EU) Limited

Tel: +44 (0) 20 7348 8857

Email: Mike....@corp.aol.com

AIM: mikegahanuk

68 Hammersmith Road

London

W14 8YW

www.aol.co.uk

www.aol.co.uk/mediaspace

Try our new products http://beta.aol.co.uk/

This e-mail, its content and any files transmitted with it are
confidential and may be legally privileged. If you receive it in error
or are not the intended recipient you must not copy, distribute or take
any action in reliance upon it. Instead, please notify us immediately by
telephoning +44 (20) 7348 8000 - ask for the Legal Department - and
delete the material from your systems. In the UK, AOL Europe is a
business carried on by AOL (UK) Limited, a company registered with the
Registrar of Companies for England and Wales under number 3462696.
Registered office: 68 Hammersmith Road, London, W14 8YW.

Jade Rubick

unread,
Jun 3, 2009, 1:06:39 PM6/3/09
to AOLS...@listserv.aol.com
This is code we inherited. Basically it wraps ns_schedule_proc with a job scheduled, that ensures everything has been run, and schedules items that didn't to run again.

We could probably rewrite this code, but if there was an easy way to look up the thread id of all current threads, it would save us (quite a bit of) work.

Jade

Jade Rubick
Director of Development
TRUiST
120 Wall Street, 4th Floor
New York, NY USA
jru...@truist.com
+1 503 285 4963
+1 707 671 1333 fax

www.truist.com


The information contained in this email/document is confidential and may be legally privileged. Access to this  mail/document by anyone other than the intended recipient(s) is unauthorized. If you are not an intended recipient, any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance to it, is prohibited.

Tom Jackson

unread,
Jun 3, 2009, 2:32:12 PM6/3/09
to AOLS...@listserv.aol.com
I have copies of some docs here:

http://rmadilo.com/files/as23docs/index.html

http://rmadilo.com/files/docs/toc.html

http://rmadilo.com/files/nsapi/

And various other info under:

http://rmadilo.com/files/

and Tcl, AOLserver and related docs:

http://junom.com/document/

You can search the almost the entire AOLserver source code at:

http://junom.com/gitweb/gitweb.perl?p=aolserver.git

(using pickaxe)

Also the changelogs might help in the last one.

tom jackson

Nick Miller

unread,
Jun 3, 2009, 5:05:07 PM6/3/09
to AOLS...@listserv.aol.com
Hi Mike,

The same stuff (I think) that was on dev.aolserver.com is on
http://panoptic.com/wiki/aolserver/AOLserver_Wiki

I am not sure which was most up-to-date.

Dossy, do you look after the dev.aolserver.com site? I think it can
not connect to the database any more.

Nick


2009/6/3 Gahan, Mike <mike....@corp.aol.com>:

Sep Ng

unread,
Jun 3, 2009, 9:42:44 PM6/3/09
to AOLS...@listserv.aol.com
Yeah. It would save quite a bit of time and effort if we could get a
list of thread ids as this is the prime use of the code we inherited.
I'm going to have a look at the XOTcl Request Monitor module on
openacs and see if there's anything I can use from that.

On Jun 4, 1:06 am, Jade Rubick <jrub...@TRUIST.COM> wrote:
> This is code we inherited. Basically it wraps ns_schedule_proc with a job
> scheduled, that ensures everything has been run, and schedules items that
> didn't to run again.
>
> We could probably rewrite this code, but if there was an easy way to look up
> the thread id of all current threads, it would save us (quite a bit of)
> work.
>
> Jade
>
> Jade Rubick
> Director of Development
> TRUiST
> 120 Wall Street, 4th Floor
> New York, NY USA

> jrub...@truist.com

Reply all
Reply to author
Forward
0 new messages