You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by titanium metal <ti...@hotmail.com> on 2004/10/06 15:31:26 UTC

High Traffic Scenario for Velocity

Hi,

I am evaluating if we can use Velocity for a high traffic site, which during 
mon-wed can get around 10 million users.

It would be a hosted solution and for EACH CLINET the site will have its own 
customization. The number of client will be around 200 and the combined 
user(for all the clients) accessing the application during the weekdays 
would be 15 million. There will be around 80 pages in the application and 
for 200 clients we might have to create 80 * 200 templates (approx).

We are looking at struts, velocity on jboss as one of the option.

1) Is there any site which works on the above combination and high traffic 
scenario using web macro ? Are there any performance statistics available ?

2) Can you point me to the caching options in Velocity?

3) From your perspective, how does velocity compare to webmacro and cocoon ?

Titanium.

_________________________________________________________________
Apply to over 65,000 jobs now. 
http://www.naukri.com/msn/index.php?source=hottag Post your CV on naukri.com 
today.


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: High Traffic Scenario for Velocity

Posted by Jochen Toppe <jo...@jtoee.com>.
I just did a very small and inconclusive 10-minute-setup-time load test. A
JSP and a velocity script using the velocityservlet.

<html>
  <head><title>Simple jsp page</title></head>
  <body>
    #foreach ( $i in [1..5000] )
      Count is $velocityCount
      Time is $foo.Time
      $foo.concatenate("A", "B")
      <br />
    #end
</body>
</html>

vs.

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body>
  <%
    FooClass foo = new FooClass();

    for ( int i =1; i<5000; i++)
    {
      %>
      Count is <%=i%>
      Time is <%= foo.getTime() %>
      <%= foo.concatenate("A", "B") %>
      <br />
      <%
    }
  %>
  </body>
</html>

FooClass doesn't really do anything, I just wanted to have a few method
calls to an object. I then measured the response time for a http request
using jmeter. Tomcat 4.1.30.

For loopcount 500: No difference, both around 10 ms.
For loopcount 5000: jsp: 109ms, velocity: 122ms.

Now I grant you the scenario is not realistic, but they are both pretty
close in performance for such a _simple_ script. Would be interesting to
have taglibs and such (but would that be fair? there is no counterpart in
velocity).

So I don't see a 2x-3x performance degradation in JSP (which would have
suprised me).

Cheers,
  Jochen

> Thursday, October 7, 2004, 9:09:01 AM, Jochen Toppe wrote:
>
>
>> Interesting. I will have definite figures in my hand in a few weeks :)
>> I'll post them.
>>
>>
>> Jochen
>>
>>
>>> In my experience, your assumption is wrong.  I think I've spilled
>>> this to the list before... I once had a small app that I wrote using
>>> exclusive servlets/velocity.  Then I realized I'd created a small app
>>> that only *I* could maintain because no one else knew/loved velocity
>>> like I did. I also needed to start adding graphs to my app, and I went
>>> the easy cewolf/jfreechart route (which requires jsp/taglibs).
>>>
>>> Anyways... even on the pages without taglibs (to satisfy those that
>>> say "it's the taglibs"), I found that when I re-wrote my pages as JSP,
>>> the pages were (anecdotally, and completely unofficially with no stats
>>> to back it up).. at least 2-3x slower.
> [snip]
>
>
> I understand that what you say it "anecdotally, and completely
> unofficially", but still, how did you measured that? Between which points
> of the response production? How big time are we talking about (say, 0.01 s
> versus 0.02-0.03 s)?
>
> --
> Best regards,
> Daniel Dekany
>
>
>
> ____________________________________________________________________
> Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a
> FreeStarttol.
> Probald ki most! http://www.freestart.hu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: High Traffic Scenario for Velocity

Posted by Mike Curwen <g_...@globallyboundless.com>.
Much more anecdotal than all that. Purely  "user experiential".

I was not only the developer, but the primary user of the little app in
question.  So I had become very used to a certain response rate. That rate
would be best described as "instantaneous".  I would click a button, or hit
'refresh', and the page would be there with no perceivable delay.

Now when I did my conversion to JSP, I had the old Velocity app still up and
running, and the JSP version up in a different host. So I could do a
side-by-side.
 
The JSP app I'd click a button or hit refresh, and I was able to count in my
head "1.... 2.... done".  Before I'd see a page.  It was visibly and
obviously slower.



> 
> I understand that what you say it "anecdotally, and 
> completely unofficially", but still, how did you measured 
> that? Between which points of the response production? How 
> big time are we talking about (say, 0.01 s versus 0.02-0.03 s)?
> 
> -- 
> Best regards,
>  Daniel Dekany
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: High Traffic Scenario for Velocity

Posted by Daniel Dekany <dd...@freemail.hu>.
Thursday, October 7, 2004, 9:09:01 AM, Jochen Toppe wrote:

> Interesting. I will have definite figures in my hand in a few weeks :)
> I'll post them.
>
> Jochen
>
>> In my experience, your assumption is wrong.  I think I've spilled this to
>>  the list before... I once had a small app that I wrote using exclusive
>> servlets/velocity.  Then I realized I'd created a small app that only *I*
>>  could maintain because no one else knew/loved velocity like I did. I
>> also needed to start adding graphs to my app, and I went the easy
>> cewolf/jfreechart route (which requires jsp/taglibs).
>>
>> Anyways... even on the pages without taglibs (to satisfy those that say
>> "it's the taglibs"), I found that when I re-wrote my pages as JSP, the
>> pages were (anecdotally, and completely unofficially with no stats to back
>> it up).. at least 2-3x slower.
[snip]

I understand that what you say it "anecdotally, and completely
unofficially", but still, how did you measured that? Between which
points of the response production? How big time are we talking about
(say, 0.01 s versus 0.02-0.03 s)?

-- 
Best regards,
 Daniel Dekany


____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: High Traffic Scenario for Velocity

Posted by Jochen Toppe <jo...@jtoee.com>.
Interesting. I will have definite figures in my hand in a few weeks :)
I'll post them.

Jochen

> In my experience, your assumption is wrong.  I think I've spilled this to
>  the list before... I once had a small app that I wrote using exclusive
> servlets/velocity.  Then I realized I'd created a small app that only *I*
>  could maintain because no one else knew/loved velocity like I did. I
> also needed to start adding graphs to my app, and I went the easy
> cewolf/jfreechart route (which requires jsp/taglibs).
>
> Anyways... even on the pages without taglibs (to satisfy those that say
> "it's the taglibs"), I found that when I re-wrote my pages as JSP, the
> pages were (anecdotally, and completely unofficially with no stats to back
> it up).. at least 2-3x slower.
>
> Maybe it was a container issue. maybe the vm could be tweaked. But
> regardless, the same app with Velocity as the view layer beat the pants
> off the same app with JSP as the view layer (all other things remained
> equal, like same server/vm/tomcat version).
>
> YYMV.
>
>
>> -----Original Message-----
>> From: Jochen Toppe [mailto:jochen@jtoee.com]
>> Sent: Wednesday, October 06, 2004 5:14 PM
>> To: Velocity Users List
>> Subject: RE: High Traffic Scenario for Velocity
>>
>>
>>
>> Ok, let me clarify: Velocity TEMPLATES aren't compiled code,
>> neither are they bytecode that gets JIT-compiled or anything ;) Meaning
>> take a JSP which gets translated and lateron compiled and compare to a
>> veloc template. I assume the JSP is faster (not taking any container
>> magic into account)
>>
>> Always so picky ;) It's after midnight!
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Velocity and Charts

Posted by Will Glass-Husain <wg...@forio.com>.
You can also use arrays to pass in a list of arbitrary length to a macro.

Our system uses a servlet to generates charts.  (It's a wrapper around 
KavaCharts by VE software).  The charts are requested with a custom URL 
generated by the macro

#LineGraph(['var1','var2','var3','var4'] $xval $yval)

http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm

I think it's a little confusing spaces are used to separate out macro params 
and commas for the arrays. but otherwise it's ok.

WILL




----- Original Message ----- 
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Users List'" <ve...@jakarta.apache.org>
Sent: Wednesday, October 06, 2004 5:11 PM
Subject: FYI: Velocity and Charts


> Mike wrote in another thread:
>> needed to start adding graphs to my app, and I went the easy
>> cewolf/jfreechart route (which requires jsp/taglibs).
>
> Funny -- a colleague brought the CEWOLF package up the other day.
> http://cewolf.sourceforge.net/
>
> I'm the resident "I luv Velocity" geek and so he asked me how to run the 
> JSP
> Taglib inside Velocity. After wretching a bit <grin> I explained that he'd
> might wrap the taglib code inside a Velocity Tool and then figure out a 
> way
> to pass the config data to it.
>
> He found somebody who has done that already it seems for the webwork 
> stuff,
> I don't endorse the architecture (the #bodytag macro kinda makes my skin
> crawl), but it's worth a look:
> http://wiki.opensymphony.com/display/WW/CeWolf+charts+using+Velocity+templat
> es
>
> One interesting thing Patrick(?) is a neat little trick to pass params as
> name value pairs in a macro. Simple way to keep the params clearly labeled
> and allow any order which can get hairy for macros with a lot of params
> #foo("red" "blue" 42 52 "hike!")
>
> #tag( ChartImg "chartid=line" "renderer=cewolf" "width=400" "height=300" )
>
> Lastly -- I found a tiny Flash project which will render charts 
> client-side.
> The object/embed tag is generated by PHP, but of course that could be
> converted to Velocity.
>
> http://www.maani.us/charts/index.php?menu=Gallery
>
>
> Cheers,
> Timo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


FYI: Velocity and Charts

Posted by Tim Colson <tc...@cisco.com>.
Mike wrote in another thread:
> needed to start adding graphs to my app, and I went the easy
> cewolf/jfreechart route (which requires jsp/taglibs).

Funny -- a colleague brought the CEWOLF package up the other day.
http://cewolf.sourceforge.net/

I'm the resident "I luv Velocity" geek and so he asked me how to run the JSP
Taglib inside Velocity. After wretching a bit <grin> I explained that he'd
might wrap the taglib code inside a Velocity Tool and then figure out a way
to pass the config data to it.

He found somebody who has done that already it seems for the webwork stuff,
I don't endorse the architecture (the #bodytag macro kinda makes my skin
crawl), but it's worth a look:
http://wiki.opensymphony.com/display/WW/CeWolf+charts+using+Velocity+templat
es

One interesting thing Patrick(?) is a neat little trick to pass params as
name value pairs in a macro. Simple way to keep the params clearly labeled
and allow any order which can get hairy for macros with a lot of params
#foo("red" "blue" 42 52 "hike!")

#tag( ChartImg "chartid=line" "renderer=cewolf" "width=400" "height=300" )

Lastly -- I found a tiny Flash project which will render charts client-side.
The object/embed tag is generated by PHP, but of course that could be
converted to Velocity.

http://www.maani.us/charts/index.php?menu=Gallery


Cheers,
Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: High Traffic Scenario for Velocity

Posted by Mike Curwen <g_...@globallyboundless.com>.
In my experience, your assumption is wrong.  I think I've spilled this to
the list before... I once had a small app that I wrote using exclusive
servlets/velocity.  Then I realized I'd created a small app that only *I*
could maintain because no one else knew/loved velocity like I did. I also
needed to start adding graphs to my app, and I went the easy
cewolf/jfreechart route (which requires jsp/taglibs).

Anyways... even on the pages without taglibs (to satisfy those that say
"it's the taglibs"), I found that when I re-wrote my pages as JSP, the pages
were (anecdotally, and completely unofficially with no stats to back it
up).. at least 2-3x slower.
 
Maybe it was a container issue. maybe the vm could be tweaked. But
regardless, the same app with Velocity as the view layer beat the pants off
the same app with JSP as the view layer (all other things remained equal,
like same server/vm/tomcat version).
 
YYMV.

> -----Original Message-----
> From: Jochen Toppe [mailto:jochen@jtoee.com] 
> Sent: Wednesday, October 06, 2004 5:14 PM
> To: Velocity Users List
> Subject: RE: High Traffic Scenario for Velocity
> 
> 
> Ok, let me clarify: Velocity TEMPLATES aren't compiled code, 
> neither are they bytecode that gets JIT-compiled or anything 
> ;) Meaning take a JSP which gets translated and lateron 
> compiled and compare to a veloc template. I assume the JSP is 
> faster (not taking any container magic into
> account)
> 
> Always so picky ;) It's after midnight!
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: High Traffic Scenario for Velocity

Posted by Jochen Toppe <jo...@jtoee.com>.
Ok, let me clarify: Velocity TEMPLATES aren't compiled code, neither are
they bytecode that gets JIT-compiled or anything ;) Meaning take a JSP
which gets translated and lateron compiled and compare to a veloc
template. I assume the JSP is faster (not taking any container magic into
account)

Always so picky ;) It's after midnight!

Jochen

> not sure what " Velocity just isn't compiled code. " means.
>
> Do you mean serverside java app isn't compiled code, unlike cgi sites
> that use compiled c/c++ ?
>
> velocity itself is as compiled as everything else running in the jvm
> (class
> files are the result of a compilation).
>
> So that leaves the templates.  And you already know the AST is cached.
> Templates are parsed (not compiled), and only parsed once.  And anecdotal
> evidence suggests that Velocity templates whip JSP in the speed department
>  (even "pre-compiled" JSP's).
>
>
> Or did you mean "Velocity isn't just compiled code." ?  Cause in that
> case, I refer you back to the anecdotal evidence that cached AST whips
> compiled code (if that compiled code is your typical JSP).
>
>
>
>
>> -----Original Message-----
>> From: Jochen Toppe [mailto:jochen@jtoee.com]
>> Sent: Wednesday, October 06, 2004 4:19 PM
>> To: Velocity Users List
>> Subject: Re: High Traffic Scenario for Velocity
>>
>>
>>
>> Resin used to be faster than Tomcat 3.x, but with TC 5.0? I
>> somehow doubt it is that much faster anymore, but I haven't seen any
>> numbers lately.
>>
>> As to the high traffic site. Soon, I'm working on it, 600
>> million PI/month enough? OK, it won't solely be velocity based, just to
>> allow the customer to exchange little snippets inside the portal
>> framework using their own templates. I am however fortunate enough to
>> use a CMS system with excellent caching and not to have to generate
>> fully personalized pages.
>>
>> Load tests are pending in our project, I do expect a
>> degradation in performance, that is obvious. Velocity just isn't compiled
>> code. I don't expect it to be a problem though, there is that cache :)
>>
>> As far as caching is concerned, one can always look into
>> using a caching framework like oscache (opensymphony.org) on top of
>> everything. Velocity itself just caches the parsed AST trees (which is
>> good, I would hate to have to reparse the templates all the time). That
>> and good design are probably all you need.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: High Traffic Scenario for Velocity

Posted by Mike Curwen <g_...@globallyboundless.com>.
not sure what " Velocity just isn't compiled code. " means.

Do you mean serverside java app isn't compiled code, unlike cgi sites that
use compiled c/c++ ?  
 
velocity itself is as compiled as everything else running in the jvm (class
files are the result of a compilation).

So that leaves the templates.  And you already know the AST is cached.
Templates are parsed (not compiled), and only parsed once.  And anecdotal
evidence suggests that Velocity templates whip JSP in the speed department
(even "pre-compiled" JSP's).  

Or did you mean "Velocity isn't just compiled code." ?  Cause in that case,
I refer you back to the anecdotal evidence that cached AST whips compiled
code (if that compiled code is your typical JSP).




> -----Original Message-----
> From: Jochen Toppe [mailto:jochen@jtoee.com] 
> Sent: Wednesday, October 06, 2004 4:19 PM
> To: Velocity Users List
> Subject: Re: High Traffic Scenario for Velocity
> 
> 
> Resin used to be faster than Tomcat 3.x, but with TC 5.0? I 
> somehow doubt it is that much faster anymore, but I haven't 
> seen any numbers lately.
> 
> As to the high traffic site. Soon, I'm working on it, 600 
> million PI/month enough? OK, it won't solely be velocity 
> based, just to allow the customer to exchange little snippets 
> inside the portal framework using their own templates. I am 
> however fortunate enough to use a CMS system with excellent 
> caching and not to have to generate fully personalized pages.
> 
> Load tests are pending in our project, I do expect a 
> degradation in performance, that is obvious. Velocity just 
> isn't compiled code. I don't expect it to be a problem 
> though, there is that cache :)
> 
> As far as caching is concerned, one can always look into 
> using a caching framework like oscache (opensymphony.org) on 
> top of everything. Velocity itself just caches the parsed AST 
> trees (which is good, I would hate to have to reparse the 
> templates all the time). That and good design are probably 
> all you need.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: High Traffic Scenario for Velocity

Posted by Jochen Toppe <jo...@jtoee.com>.
Resin used to be faster than Tomcat 3.x, but with TC 5.0? I somehow doubt
it is that much faster anymore, but I haven't seen any numbers lately.

As to the high traffic site. Soon, I'm working on it, 600 million PI/month
enough? OK, it won't solely be velocity based, just to allow the customer
to exchange little snippets inside the portal framework using their own
templates. I am however fortunate enough to use a CMS system with
excellent caching and not to have to generate fully personalized pages.

Load tests are pending in our project, I do expect a degradation in
performance, that is obvious. Velocity just isn't compiled code. I don't
expect it to be a problem though, there is that cache :)

As far as caching is concerned, one can always look into using a caching
framework like oscache (opensymphony.org) on top of everything. Velocity
itself just caches the parsed AST trees (which is good, I would hate to
have to reparse the templates all the time). That and good design are
probably all you need.

Cheers,
  Jochen

> On Thu, 07 Oct 2004 02:31, titanium metal wrote:
>
>> Hi,
>>
>>
>> I am evaluating if we can use Velocity for a high traffic site, which
>> during mon-wed can get around 10 million users.
>>
>> It would be a hosted solution and for EACH CLINET the site will have
>> its own customization. The number of client will be around 200 and the
>> combined user(for all the clients) accessing the application during the
>> weekdays would be 15 million. There will be around 80 pages in the
>> application and for 200 clients we might have to create 80 * 200
>> templates (approx).
>>
>> We are looking at struts, velocity on jboss as one of the option.
>>
>
> JBoss I believe uses Tomcat as an engine. Resin may be faster - although
> I
> havn't seen any recent performance comparisions. Tomcat used to be the
> slower of the bunch.
>
>> 1) Is there any site which works on the above combination and high
>> traffic scenario using web macro ? Are there any performance statistics
>> available ?
>
> I can't see any studies comparing various technology to each other.
>
>
>> 2) Can you point me to the caching options in Velocity?
>>
>
> One solution I wrote previously creates static pages using Velocity.
> Obviously
> this isn't dynamic - its just a system to be able to author content. In
> terms of Velocity caching the templates the OS usually caches commonly
> used files anyhow.
>
>> 3) From your perspective, how does velocity compare to webmacro and
>> cocoon ?
>>
>
> I havn't performed direct comparisions in terms of performance, however
> we changed from WebMacro about two years ago due to certain features being
>  available in Velocity. We can now deliver custom PDF's, and OpenOffice
> documents using Velocity. Its fast and you can replace them at runtime
> without issue - where its not so easy with JSP in practise.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: High Traffic Scenario for Velocity

Posted by Peter Harrison <pe...@nothingbutnet.co.nz>.
On Thu, 07 Oct 2004 02:31, titanium metal wrote:
> Hi,
>
> I am evaluating if we can use Velocity for a high traffic site, which
> during mon-wed can get around 10 million users.
>
> It would be a hosted solution and for EACH CLINET the site will have its
> own customization. The number of client will be around 200 and the combined
> user(for all the clients) accessing the application during the weekdays
> would be 15 million. There will be around 80 pages in the application and
> for 200 clients we might have to create 80 * 200 templates (approx).
>
> We are looking at struts, velocity on jboss as one of the option.

JBoss I believe uses Tomcat as an engine. Resin may be faster - although I 
havn't seen any recent performance comparisions. Tomcat used to be the slower 
of the bunch.

> 1) Is there any site which works on the above combination and high traffic
> scenario using web macro ? Are there any performance statistics available ?

I can't see any studies comparing various technology to each other.

> 2) Can you point me to the caching options in Velocity?

One solution I wrote previously creates static pages using Velocity. Obviously 
this isn't dynamic - its just a system to be able to author content. In terms 
of Velocity caching the templates the OS usually caches commonly used files 
anyhow.

> 3) From your perspective, how does velocity compare to webmacro and cocoon
> ?

I havn't performed direct comparisions in terms of performance, however we 
changed from WebMacro about two years ago due to certain features being 
available in Velocity. We can now deliver custom PDF's, and OpenOffice 
documents using Velocity. Its fast and you can replace them at runtime 
without issue - where its not so easy with JSP in practise.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org