• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

servlets performances

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my servlet's main functionality is "parsing incoming data from applets and then inserting into database (not data but only update statements)." , i have already separated servlets to multipule so that single servlet do not take all the load , but can you please tell me that,
- should this servlet implement "SingleThreadModel" or not ?
- the methods which parse data and insert into database , should those methods be "synchronized" methods or not ?
- right now whenever servlet initialized , i open the database connection and the use that statment through out all the methods , is it good implementation for interaction with the database or not. ?
- there are multipule servlets for different data but they all perform same tasks , so when there are number of servlet , is tomcat is good enough to handle these many instances of servlets ,
- what is the limitation of tomcat , what is good option for tomcat for above requirments. ?
thanks
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Do not use SingleThreadModel
2. Since creating a database connection is very time consuming, use a database connection pool.
3. Your limitation is going to be the db connection speed, not the Tomcat speed.
Bill
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic