Re: templating benchmarks...
This benchmark can be very non-representive. If you don't know how to optimize each and every thing under test, you end up with unfair benchmark and come to potentially wrong conclusions. Take TT, add compiled template caching on the disk and shared TT object and I bet TT won't be at the bottom. In any case always remember that it's extremely hard to run a fair benchmark. I'd say it's almost impossible. The only fair benchmarking can be done if you know all the in's and out's of the 'things' under test and provide many benchmark tests each exploring a single property and not just 'one for all' benchmark. Of course it's a good thing to have benchmarks, but they all should be taken with a grain of salt. Absolutely. But I'd like to bring up something I've noticed in benchmarking 'real' sites: many, if not all, of the templating solutions appear to parse the whole of an html page. This is at least true of Apache::ASP and HTML::Mason, which I have used. Is it not ? I have produced really dramatic differences in performance in a two-tier setup by judicious use of mod_include vs. wholesale proxying of pages with dynamic content through to the mod_perl/Apache::ASP server. For example: In a situation with 1 lightweight frontend proxy and two backend mod_perl/Apache::ASP app servers ( with load distributed evenly using a patched mod_rewrite and its ability to select randomly from a list in a file ) , in one part of the site the dynamic headers and footers are generated by using !--#include virtual=/apps/include/pane.html?pane=headerlocation=$REQUEST_URI --, where the file being included is in fact proxied back to the app servers to receive content; in other parts of the site similarly simple pages are proxied in their entirety to the app servers. The results I can produce ( granted only with 'ab' ) are stunningly different: when I request the header and footer from the app servers using mod_include plus my modified mod_rewrite ( the stock version refuses to rewrite proxied requests ), I get up to 600 requests / second. When proxying the whole page through I get around 6 requests / second. Granted, I have other major bottlenecks involved: using Berkeley DB v1.x for session state, for one. Perhaps this explains some of it -- maybe the proxied header/footer requests never make session calls. I suspect that the wholesale parsing/eval-ing of html pages also plays a part. What do y'all think ? Tom _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Apache pnotes
The Eagle Books explanation of notes isn't very clear. Could someone point me to a page that explains it somewhat better? In what situation would it be beneficial to use them? Jamie Krasnoo [EMAIL PROTECTED]
Re: Apache pnotes
On Sat, 9 Jun 2001, Jamie Krasnoo wrote: The Eagle Books explanation of notes isn't very clear. Could someone point me to a page that explains it somewhat better? In what situation would it be beneficial to use them? You use notes (or pnotes) when you want a kind of global variable that is localised to the request, but also accessible to sub-requests. For example, Apache::Request stores it's current instance in pnotes, so that it's guaranteed to be unique to that request. If it were stored in a global, it would be the same apr object in subrequests. Use pnotes instead of notes when you either need to store a perl object, or need to store binary nulls. -- Matt/ /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\
Re: comparison of templating methods?
will trillich wrote: HTML::Mason Template-Toolkit tuppence type='mine' These are only two I have much experience with. I've found both to be well written, stable and well supported. TT makes it easier to separate the logic from the presentation layer IMHO. But every time I code a project in mason I find myself smiling and thinking 'This is fun', at least occasionally. Projects seem to come together _much_ faster with Mason, though overall coding time isn't much different. With Mason you have to work harder if you want to separate logic presentation, but its fairly straightfoward if you put some thought into your component design ahead of time. So typically, if I need skinability, or if I need to give edit capability to html'ers with no perl but light scripting ability I use TT, otherwise I use Mason. /tuppence J
Re: comparison of templating methods?
will trillich wrote: HTML::Mason Template-Toolkit tuppence type='mine' These are only two I have much experience with. I've found both to be well written, stable and well supported. TT makes it easier to separate the logic from the presentation layer IMHO. But every time I code a project in mason I find myself smiling and thinking 'This is fun', at least occasionally. Projects seem to come together _much_ faster with Mason, though overall coding time isn't much different. With Mason you have to work harder if you want to separate logic presentation, but its fairly straightfoward if you put some thought into your component design ahead of time. So typically, if I need skinability, or if I need to give edit capability to html'ers with no perl but light scripting ability I use TT, otherwise I use Mason. /tuppence J
Re: comparison of templating methods?
will trillich wrote: HTML::Mason Template-Toolkit tuppence type='mine' These are only two I have much experience with. I've found both to be well written, stable and well supported. TT makes it easier to separate the logic from the presentation layer IMHO. But every time I code a project in mason I find myself smiling and thinking 'This is fun', at least occasionally. Projects seem to come together _much_ faster with Mason, though overall coding time isn't much different. With Mason you have to work harder if you want to separate logic presentation, but its fairly straightfoward if you put some thought into your component design ahead of time. So typically, if I need skinability, or if I need to give edit capability to html'ers with no perl but light scripting ability I use TT, otherwise I use Mason. /tuppence J
i use linux+apache. how to create a cgi-bin directory for Virtual Host?
my system is build on linux+apache now i'm create virtual hosts.i change the config file (/opt/apache/conf/httpd.conf)like this: # get the server name from the Host: headerUseCanonicalName Off# this log format can be split per-virtual-host based on the first fieldLogFormat "%V %h %l %u %t \"%r\" %s %b" vcommonCustomLog logs/access_log vcommon # include the server name in the filenames used to satisfy requestsVirtualDocumentRoot /www/hosts/%0/VirtualScriptAlias /www/hosts/%0/cgi-bin now i try to browse the virtual host ,i canget http://www.1.com/test.htm (which is in /www/hosts/www.1.com/,) but can not get http://www.1.com/test.pl .(which is in /www/hosts/www.1.com/cgi-bin),the system can't find the file. yet i can get http://localhost/cgi-bin/test.pl,(which is in /opt/apache/cgi-bin),why? by the way,i need create many virtual host,so i mustdo dynamic creating like above.