• 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

Scalability of JSP

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

What are factors which affect the scalability of JSP page?
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by amit sanghai:
What are factors which affect the scalability of JSP page?


A simple question but it jumps into a whole pit full of snakes. Typically a web application consists of multiple logical layers (JSP/presentation, application server, database) and physical components (networks, routers, machines, storage). Scalability issues can arise in all of them, and the whole is no stronger than the weakest link.
JSPs, by and of themselves, are very scalable. They are multithreaded (unless you implement SingleThreadModel), can therefore be used by many clients simultaneously, and hold no state and can therefore be replicated at will.
Now if that were all, scalability would be near-perfect as you can simply fling more machines at a problem when necessary. But you will generally want to maintain some kind of client state somewhere (user profile, site content...). Typically, temporary state goes into your session object, the rest into a database back-end.
Scalability, then, is first and foremost determined by the application server and the database plus the hardware that supports them.
If a single application server instance can no longer handle the load, you either need a server that will share session information across multiple machines, or need a load balancing set-up that will redirect clients to the same server for every request.
Database access can have a major impact on scalability. If you are setting up JDBC connections in your JSP, that is going to severely limit your scalability -- always use a connection pool (either accessed directly from the JSPs/servlets/beans or indirectly via EJBs). If the database layer itself runs into scalability problems, think about replicating static or near-static data into multiple databases and splitting up your dynamic data across volumes or even machines.
Does that answer your question?
- Peter
reply
    Bookmark Topic Watch Topic
  • New Topic