Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Increase the speed of Tomcat??

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all friends,
Can any one plz guide me how i can increase the speed of tomcat server.I am using Tomcat4.0.1 .I am using tomcat server for uploading file on remote destination through servlet.Iam uploading big size of file (about 100MB or 150MB file) but the speed of writing file on destination is very slow.Iam writing file on destination through my servlet as a block of 1024 bytes.My computer's physical RAM is 512MB.Plz guide me how I can slove my problem.
Regards
Bikash
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're sure the speed slow-down is on the file writing, and not in the pipe between your uploading computer and server ?
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Now by increasing the maximum heap size of JVM the speed of file writing increases upto some extent.Now during uploading Tomcat server uses 98% to 100% CPU,Is it the right way? My networking have done through 2MBPS dedicated lease line.I have tested my networking speed by manual copy and paste,it is ok.Plz guide me what is the best way to increase the speed of file writing on destination.
Regards
Bikash
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your are writing to file with a BufferedWriter, you may increase the size of the buffer.
 
Saloon Keeper
Posts: 27933
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual approach when performance is an issue is to front-end Tomcat with the Apache webserver. It's so common, that this forum is named "Apache/Tomcat".
A file that big sounds like it's not really an HTTP-style transmission. Even if it's something like a really large SOAP request, you might check to see if there are other server solutions you might use instead (depending on network topology, firewalls and administrative policies).
Just as an example, although I could have generated a bot to download OS updates from my supplier via HTTP or FTP, they also run an rsync server which allows me to maintain a mirror of the update site more optimally.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you limited to writing 1024 byte blocks or can you use larger ones? Does your servlet do any creation of new objects for every block? You are reading and writing bytes, right? Character conversion with strings can be a major overhead.
Bill
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does anyone know if using the -server option in the 1.4 JVM would help in this instance? Is I/O optimized for -server, rather than -client (which is the default).
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic