Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

http file caching on linux

 
Jared Ojared
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a jdk installed on a suse linux box is there some soft of default folder where http files are cached? I know with webstart you can locate some kind of cache folder, wondering if that cache is similar in nature to the cache for web browsers.

I am running a tomcat instance and would like to know how to cache a file to speed up requests.

Any ideas?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. Are you running Tomcat on this Linux box? Or is Tomcat running elsewhere and you are running a browser on a Linux box and accessing Tomcat? If the latter, then the browser should automatically cache the file somewhere in a hidden directory in your home directory (exact location depends on the browser).
 
Jared Ojared
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter not quite:

Tomcat etc on a linux box. A method inside my tomcat server is http getting another url (not hosted by me, an external url) through URL and URLConnection.

This URL connection response is large, slow and I want to cache it. I think the only way to do it is to use squid to cache the response.
 
Tim Holloway
Saloon Keeper
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat is a server and does not cache anything. The clients have to do their own caching, or (as you mentioned), access via a caching proxy, such as squid. Java itself has no caching capabilities.
 
luke swagger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need to do some speed tests and benchmarks on my hard disk drive. Unfortunately the files being written/read are being cached, (normally it's a good thing, but not when I need to accurately measure the performance of the harddisk). I looked in 'mount' options, 'hdparm', even the kernel configuration. Unfortunately I couldn't find anything. I feel that it should be a simple switch somewhere, but I'm just missing it.
Please, if any one knows how to disable the cache, I'd appreciate the help. Even if it takes to hack the kernel, I have no problem.
Thanks in advance,
 
Tim Holloway
Saloon Keeper
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Gold Standard for Linux-based disk performance testing is Bonnie.

However, Bonnie is designed specifically to test the physical hard drive and filesystem performance.

If you're looking for performance specific to a single application system, such as Tomcat, then you need to construct a test framework that mimics the production loads as accurately as possible. Programs such as jMeter can help there.
 
evan tanski
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Linux loves to cache I/O. It likes it so much, that it’ll try to cache virtually everything you throw at it. Generally, this is a good thing. Caching files means that the file that’s on the hard disk is placed inside the system memory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic