• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to design/architect for a specified performance

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am currently working on SCEA part 2. I have been asked to
architect/design a solution to a given problem and there are some
specific performance requirements.

While I may employ a combination of several design patterns, best
practices that are suitable for high performance, how do I make sure
that the final design (that's based on the architecure/high level
design that I create) WILL ensure a specified performance, say "x"
seconds, given the fact that the user accesses the application using
his LAN/broad band (MBPS) or has a modem with a specific KBPS?

Just as an additional input, I used my laptop to connect the Internet
using
1. A 58.8 KBPS modem
2. Broad band (~ few MBPS)

I accessed several popular severs including Amazon, Google, Sun, IBM,
Dell, some banking sites etc. The response time for the base page(no
logging in), was anywhere in the range of 5 to 40 sec using the modem
and less than a sec to 5 sec using broadband. This is not a true
testing of performance, but does show the stark differences between
the "mode" of connection a client uses.

You may also provide me reference to relevant threads, useful links etc.

Thanks & Regards,
Ram Chandramouli
 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the performance requirements are not with respect to network.

You need to provide justification for the architecture you have choosen for the application ( wrt performance). For example, use of local entity beans or use of transfer objects for communication across layers etc.

I don't think we have to provide any solution for network performance.

-Prasad
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ram,

You make very valid points. I also thought about these and have listed some of them under my assumptions section.

I think while designing your solution you should try and justify your best shot at meeting the performance requirement.

I mean there will be some overhead of network. There will be some more things that can build latency in request/response.

Now your design should try to meet the 5 sec (for Agents) and 10 seconds (for Customers - 20% time) SLA.

I have listed all such factors in my assumptions list and am awaiting the result.

regards,
Deepak
 
Chandramouli Ram
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to you - Prasad & Deepak for your prompt response.

Prasad,

The performance SLAs define the response time for each type of client (who are using different communication carrier). So, in my opinion, we cannot ignore the time to transimt packets over different networks. And, yes, we don't control the network but we need to account for the time to transmit. So, when the business defines a certain response time (time for a page to load on the client's machine), it includes the time that our server takes to serve a page + the time that the network takes to move the request and response across the network.

I do agree with the other general points that you are making.

Deepak,

I agree with your suggestion to add certain assumptions concerning this.

To present my concern in other words, if the requirement was:

1. 5 sec (for Agents) and 10 seconds (for Customers - 20% time) SLA
or
2. 10 sec (for Agents) and 20 seconds (for Customers - 20% time) SLA,

how differently will you architect/design a solution to the given problem with due resaons and justifications.

While your suggestions are very good for SCEA part 2, I am just curious to think beyond that, in addressing the requirements of a real customer.

Let me know your views.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ram Chandramouli:

Deepak,

I agree with your suggestion to add certain assumptions concerning this.

To present my concern in other words, if the requirement was:

1. 5 sec (for Agents) and 10 seconds (for Customers - 20% time) SLA
or
2. 10 sec (for Agents) and 20 seconds (for Customers - 20% time) SLA,

how differently will you architect/design a solution to the given problem with due resaons and justifications.

While your suggestions are very good for SCEA part 2, I am just curious to think beyond that, in addressing the requirements of a real customer.

Let me know your views.



Ram,

I would always design for best performance as thats what drives the end users day.

Between 5 sec and 10 sec there is a huge difference of 5 sec. I might introduce things like web service or introduce XML for flexibility or may be provide some more generic nice to have things. For 5 second or lower response time I would not introduce anything just because they are cool. For example: I would not introduce a webservice for travel agent because I know it would be very difficult to meet the requirement.

A small proof of concept should always be done to get some feel and handle of the proposed architecture.

Hope this helps,

Deepak
 
Chandramouli Ram
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Deepak. It does help :-)
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think in real world terms
a) when you display something to user it should be fast enough.
b) When a user updates or enters a data, a certain wait time is permitted.
To cater to requirement a, you can avoid EJB altogether by using fast lane reader pattern. But this may not be always be feasible, depending upon requirements.
Then if the table is big on which you are doing search, then don't use value list handler. For eg there are tables with millions of records and on a give n condition we have 5000 records. But we only fetch 500 records at given
time
ALso the performance is improved by tweaking queries, indexing etc.
Of course, we can awlays use local session beans and entity beans.
Vinay
 
Chandramouli Ram
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the feedback Vinay. As you have correctly pointed out, in real world, the database design and optimization of queries are very critical and can change the performance of systems even by orders of magnitude.

But then, we need to go with certain assumptions with regard to database when we architect/design for a certain performance specifications. The point I have been trying to question is how do you quantify the performance based on your design/architecture. One way to partially ascertain this is, as Deppak has suggested, try out some sample programs. But I still believe there is some quantifying that must be done in real profession. For example the accepted average response time on the Internet (a year ago) -assuming the server does not do any processing etc. is 400 millisec. Are there some such figures that we can come up with given the fact that you use a certain machine and the load is such and such factor etc. After all, in SCEA 2 assignment, you are given all details about the machine, the user load etc.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vinay,

What you say is true, but does database design or database tuning come under Architects responisbility.
If not, then obviously we will have to consider only the measures specified by Deepak and not rely on how efficient our EIS tier is, though its performance is going to obviously affect the project.

Has anybody considerd /mentioned the EIS tier in any respect.
especially the ones who have scored near to full marks.

Rashmi
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Performance requirements are always drawn in sand unless SLA clearly documents assumptions. No one can design/architect a system that can provide a differential performance based on changing infrstructure needs - for instance, it would be cool to make the system switch to an optimal network communication strategy based on the available bandwidth! Sure, it would be nice but then you will have to write the entire platform yourself!

Here are a few things I quote from my own experience -
  • Follow best practices. Consciously avoid everything that is perceived as a overhead - such as using entity beans to read 20,000 records.
  • Optimize at all tiers - from presentation to database and everything inbetween.
  • When you have to make a tradeoff decision between performance and usability, performance always comes second. A system that is usable is more important than being fastest.
  • When quantifying performance, have a reference model. Keep your variables minimum and define a predictable model. Define your SLA on this model.
  • J2EE is an application server platform. In the OSI model it is the top level. There isn't anything you can do to optimize the layers below - network, session etc.
  • Document assumptions and supported configurations.
  • Premature performance optimization is root of all evil. Designing for performance often conflicts with other design paradigms - for instance, some design patterns are actually detrimental to performance. So don't introduce performance to every single decision process.
  • Remember there are other ways to make the system perform better such as horizontal scaling, clustering, database replication, grid computing, load balancing etc. These technologies have evolved to address just one problem - how to continually and consistently perform at accepted levels in the context of changing system load.


  • I will also answer some of the other questions in this thread separately.

    HTH
     
    Ajith Kallambella
    Sheriff
    Posts: 5782
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Rashmi Razdan:

    What you say is true, but does database design or database tuning come under Architects responisbility.

    If not, then obviously we will have to consider only the measures specified by Deepak and not rely on how efficient our EIS tier is, though its performance is going to obviously affect the project.

    Has anybody considerd /mentioned the EIS tier in any respect. especially the ones who have scored near to full marks.


    Whether it is your responsibility as a J2EE architect somewhat depends on the organizational structure. Sometimes big projects have a dedicated data team. Regardless, as an enterprise archiect, you should be aware that the database is your biggest bottleneck. There is no exaggeration here. A single database read is much more expensive than a single remote method invocation, even if the database is on the same physical machine. Therefore whether it is your responsibility or not, you should be active participant in the database performance tunining activities. If you have the luxury of having a dedicated database team with a database architect( now I'm drooling) then you are their customer !

    HTH
    [ March 09, 2005: Message edited by: Ajith Kallambella ]
     
    Chandramouli Ram
    Ranch Hand
    Posts: 65
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Ajit,

    Thanks for elucidating multiple points in a single go. Can you please elaborate on the following point-I didn't understand it quite well:

    "When quantifying performance, have a reference model. Keep your variables minimum and define a predictable model. Define your SLA on this model."
     
    Rashmi Razdan
    Ranch Hand
    Posts: 70
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Ajit,
    Thanks for ur reply.
    currently the organisation im working, gives that luxury , thats why my imgagination floated in that direction.

    Reg. Follow best practices.
    Consciously avoid everything that is perceived as a overhead - such as using entity beans to read 20,000 records.

    Is it abt concurrent users?
    If u are refrering here to volume of data in table, then what about 1 milion customers reading( or crud) that data (n may be just 50,000 concurently) . shudnt we go for entity bean in that case?


    Optimize at all tiers - from presentation to database and everything inbetween.

    I guess wrt database , max as an architect we can design best/ higly normalised database!Do u agree?

    -------------------------------
     
    Ajith Kallambella
    Sheriff
    Posts: 5782
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Ram Chandramouli:
    Hi Ajit,

    Thanks for elucidating multiple points in a single go. Can you please elaborate on the following point-I didn't understand it quite well:

    "When quantifying performance, have a reference model. Keep your variables minimum and define a predictable model. Define your SLA on this model."



    Think of it as a benchmarking configuration that closely resembles real deployment setup - hardware, software, memory, dmz, firewall, etc. This will help you establish a controlled environment for response testing while still allowing you to mimic real deployment scenario. Remember, once you have established this configuration, you will *not* change it during performance testing. Now introduce the variables such as concurrent users, varying peak load, volume of data etc. These variables can change and in fact in reality, these change more frequently( and unpredictably) than the components of your configuration( such as h/w, s/w etc.)

    Repeat performance tests for different configuration setups, each time first finalizing the configuration and executing performance tests for that specific configuration. You will end up with predictable performance patterns for each defined configuration. Moving forward you can use the results to measure the deviations between your testings and one reported by your user on a live system.

    HTH
     
    Chandramouli Ram
    Ranch Hand
    Posts: 65
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Ajit,

    A very useful and excellent piece of information. This, I believe, can be used while you plan out things for a real project and hence makes lot of sense.
    Let me know if you have any pointers to some case studies, where they do similar type of work, and have published figures. This in turn can be very helpful for SCEA 2 preparations.
     
    No, tomorrow we rule the world! With this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic