Forum OpenACS Q&A: Re: Aolserver 4.5 multithreading

Collapse
Posted by Jay Dubanik on
Tom, I hope your patch to 4.5 to print the threadpool name will get in quickly, I'd like to do more tests as I am still not happy with the performance.

The problem is that even that threadpools seem to work, or at least are loaded (see below), when I run "ps -eLf" I get only 15 threads open.

1. In my understanding there in fact should be at least as many as the sum of all threadpools minthreads in my case around 90.

2. When looking at network stats with "netstat -s" (see below) the number of active connections is strangely low compared to passive conns and high number of failed connections.

Tcp:
20778 active connections openings
1798957 passive connection openings
574669 failed connection attempts
98681 connection resets received
112 connections established
45683111 segments received
57018897 segments send out
866619 segments retransmited
667 bad segments received.
220484 resets sent

========config-info===============
ns_section ns/server/myserver/pool/admin
ns_param maxconnections 100
ns_param minthreads 2
ns_param maxthreads 2
ns_param threadtimeout 120
ns_param map {GET */admin/*}
ns_param map {POST */admin/*}
ns_param map {GET /acs-admin/*}
ns_param map {POST /acs-admin/*}

ns_section ns/server/myserver/pool/fast
ns_param maxconnections 200
ns_param minthreads 10
ns_param maxthreads 20
ns_param threadtimeout 120
ns_param map {GET /*.jpg}
ns_param map {GET /*.swf}
ns_param map {GET /image/*}

ns_section ns/server/myserver/pool/mainpool
ns_param maxconnections 200
ns_param minthreads 80
ns_param maxthreads 80
ns_param threadtimeout 120
ns_param map {GET /*}
ns_param map {POST /}

ns_section ns/server/myserver/pools
ns_param fast {fast pool}
ns_param admin {admin pool}
ns_param mainpool {mainpool pool}

Collapse
Posted by Tom Jackson on

I admit that I'm no patch expert. The change needed to log the threadpool used is pretty simple:

cvs diff queue.c
Index: queue.c
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/queue.c,v
retrieving revision 1.38
diff -r1.38 queue.c
361c361
<     sprintf(name, "-conn:%d-", poolPtr->threads.nextid++);
---
>     sprintf(name, "-%s:%d-", poolPtr->name, poolPtr->threads.nextid++);

So line 361 gets a little change.

I also notice that your mainpool threadpool only maps "/" for the method POST. I haven't experimented, but this might not do anything but url = "/". If you make the change to the queue.c, maybe report if mainpool is used for POST on urls other than "/".