* forehead (for...@4r...) [040102 11:28]:
> I just use the TT2Process modules from OpenInteract 1.99
> to start my multi-style site project. all the small stuff
> viewed as widget and thought a::b::c like style to include.
>
> so one application page has many such widget to include and
> more complex TT2 template to handle, but my program is very slow,
> and i can't afford it, average the page needs
>
> 1.00 usr + 0.01 sys = 1.01 CPU
>
> to fullfill the task.and the major time sucking is in TT2 process
> directive, although the TT2Plugin not complex.\
>
> any idea to enhance the performance for my cgi program?
> it's confusing me about many weeks!
Using CGI? We're kind of barking up the wrong tree here. The CGI mode
is primarily meant for debugging, quickstart and single-user
implementations, not for heavy production use. That is, you're doing a
LOT of work on every single request:
- read in the server configuration
- read in the package listing (repository)
- read in all SPOPS definitions and generate a class for each
- read in all action definitions and generate a URL mapping for each
- read in any custom TT2 processing from the packages
- do a 'require' on all necessary modules (core modules and packages)
- create a database handle
And that's before we do any processing on the request! For single
users this is a slight delay but it's generally acceptable. For
multi-user sites I'd imagine it's intolerable.
That said, if you've actually found TT2 is your bottleneck you should
check to see if it's compiling the templates and caching the
results. See: $WEBSITE_DIR/cache/tt. If it's empty that means you're
not caching anything or you're cleaning it up with every request. Try
setting the server configuration
'template_process.main.compile_cleanup' to 0 so the compiled files
won't get cleaned up every time.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|