Are you sure that TG is Threaded ?

0 views
Skip to first unread message

william

unread,
Oct 28, 2005, 3:03:46 PM10/28/05
to TurboGears
I've made some stress tests with my first Tg application.

look here:
http://projectsmgt.opensource4you.org/ProjectsMgt/wiki/StressTests

But, if I'm correct, only 1 of the 5 processes use the CPU.
By comparison a simple CP application use 3 processes.

I've done it for Postgres, Mysql, SQLite2 and SQLite3.

Thanks

Kevin Dangoor

unread,
Oct 28, 2005, 3:10:54 PM10/28/05
to turbo...@googlegroups.com
Given that the server is CherryPy, I can assure you that TurboGears is
as threaded as CherryPy :)

Take a look at this:
http://svn.cherrypy.org/trunk/cherrypy/tutorial/tutorial.conf

If you're running TurboGears in development mode, I'm pretty sure
you're only running on a single thread. I don't remember for sure what
the default for production mode is (and to clarify things, I just
added the server.threadPool line to the quickstart prod.cfg template).

Make sure you're running with a reasonable production configuration...

Kevin
--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: k...@blazingthings.com
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

william

unread,
Oct 28, 2005, 3:18:53 PM10/28/05
to TurboGears
Thanks for quick answer Kevin,

I've re-run (here under details), but I've same result.

Am I missing something else ?


Here after my config:

# This is where all of your settings go for your development
environment

[global]

# DATABASE

# pick the form for your database
sqlobject.dburi="sqlite:///tmp/projectsmgt.db?debug=1"

# for Windows users, sqlite URIs look like:
# sqlobject.dburi="sqlite:///drive_letter|/path/to/file"


# VIEW

# kid.outputformat="html"

# The sitetemplate is used for overall styling of a site that
# includes multiple TurboGears applications
# tg.sitetemplate="<packagename.templates.templatename>"


# Server configuration
server.environment="production"
server.logFile="server.log"
server.logToScreen=False

# if this is part of a larger site, you can set the path
# to the TurboGears instance here
# server.webpath=""

[/static]
staticFilter.on = True
staticFilter.dir = "static"


the command line I've used:
python projectsmgt-start.py prod.cfg

results:
wi 8924 1.3 3.9 17124 10244 pts/1 S+ 21:13 0:00 python
projectsmgt-start.py prod.cfg
wi 8925 0.0 3.9 17124 10244 pts/1 S+ 21:13 0:00 python
projectsmgt-start.py prod.cfg
wi 8928 0.2 3.9 17124 10244 pts/1 S+ 21:13 0:00 python
projectsmgt-start.py prod.cfg
wi 8929 65.3 3.9 17124 10244 pts/1 R+ 21:13 0:22 python
projectsmgt-start.py prod.cfg


Same results ;-(.

David Stanek

unread,
Oct 28, 2005, 3:54:52 PM10/28/05
to turbo...@googlegroups.com
On 10/28/05, william <wil...@opensource4you.com> wrote:

But, if I'm correct, only 1 of the 5 processes use the CPU.
By comparison a simple CP application use 3 processes.


What are you looking for here?


--
David Stanek
www.roninds.net

Kevin Dangoor

unread,
Oct 28, 2005, 4:01:30 PM10/28/05
to turbo...@googlegroups.com
try setting server.threadPool = 10 as in the cherrypy tutorial conf.

Kevin

On 10/28/05, william <wil...@opensource4you.com> wrote:
>

william

unread,
Oct 28, 2005, 4:07:03 PM10/28/05
to TurboGears
David,

I'm doing stress tests, and some elements seems strange to me.

I'm sharing my worries ... that's all.
Am I the only one having such behaviour ?


What I'm looking for ? Simply why the different threads does have the
same behaviour between CP anf TG.
>From where the problem can come from ?
What I've missed a config items, a module ???

william

unread,
Oct 28, 2005, 4:19:25 PM10/28/05
to TurboGears
WORKS!!!!!!! Thanks Kevin.

Here, we have indeed, a good split of the workload between several
processes.

Could be nice to include by default this parameter in the prod.cfg
file.


wi 9140 1.1 5.1 29192 13228 pts/1 S+ 22:16 0:00 python
projectsmgt-start.py prod.cfg
wi 9141 0.0 5.1 29192 13228 pts/1 S+ 22:16 0:00 python
projectsmgt-start.py prod.cfg
wi 9144 0.2 5.1 29192 13228 pts/1 S+ 22:16 0:00 python
projectsmgt-start.py prod.cfg
wi 9145 12.7 5.1 29192 13228 pts/1 S+ 22:16 0:05 python
projectsmgt-start.py prod.cfg
wi 9146 13.0 5.1 29192 13228 pts/1 S+ 22:16 0:05 python
projectsmgt-start.py prod.cfg
wi 9147 13.0 5.1 29192 13228 pts/1 S+ 22:16 0:05 python
projectsmgt-start.py prod.cfg
wi 9148 12.8 5.1 29192 13228 pts/1 S+ 22:16 0:05 python
projectsmgt-start.py prod.cfg
wi 9149 12.9 5.1 29192 13228 pts/1 S+ 22:16 0:05 python
projectsmgt-start.py prod.cfg

Elvelind Grandin

unread,
Oct 29, 2005, 5:33:15 AM10/29/05
to turbo...@googlegroups.com
It is now in the default prod.cfg.

On 10/28/05, william <wil...@opensource4you.com> wrote:
>
--
cheers
elvelind grandin
Reply all
Reply to author
Forward
0 new messages