Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets performances

 
ray bond
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic