Tomcat/JSP/Servlet/STRUTS

I am about to set up my system with the Subject technologies. I am not particularly knowledgeable of Linux. I use other platforms and servers.

Could someone tell me what distributions would be recommended for this technology and give me some hints for setting it up?

5 Replies

@monden:

I am about to set up my system with the Subject technologies. I am not particularly knowledgeable of Linux. I use other platforms and servers.

Could someone tell me what distributions would be recommended for this technology and give me some hints for setting it up?

I can't help you with Tomcat, etc as I hardly ever use Java. However as far as Linux goes, if you're new I highly recommend using the Debian distro because its apt-get system makes installing software supereasy. Just type apt-get install and it'll download and install it for you. I've used many distros and Debian is by far and away the easiest to use.

Good luck!

I'm using Debian to run Tomcat 5, Java 1.4, Apache 2, and I'm experimenting with JBoss. Once it's set up Debian works really well with Java stuff. It is one of the leaner distributions, which is good because java needs all the resources it can get. Setting it up may not be that easy if you're not familiar with Debian. The problem for me was that they don't distribute a Sun JVM for the Debian package manager. I believe it's a licensing issue with Sun. They offer some third party JVMs, but they are old 1.1 versions, and I need the newer 1.4 stuff.

What I had to do is install the latest Sun binaries manually, then install these java placeholder packages with the debian package manager. It took a few iterations to get it right. The java placeholder packages tell the package manager that you already have a JVM and prevents it from installing one of those third party 1.1 JVMs. At first I didn't do this, and every time I tried installing something even remotely java related the package manager would try to install the 1.1 JVMs and it was screwing up my settings in addition to wasting space for an unneeded JVM. Anyway these are the java packages I have from Debian:

java-common, java-compiler-dummy, java2-runtime-dummy, java1-runtime-dummy, java-virtual-machine-dummy, java2-compiler-dummy

If you install the java-common package first with

apt-get install java-common

It will install some detailed documentation that tells you more about how to do various versions of java in debian. There are some detailed steps you need to follow to get the -dummy packages working right.

Once I got the JVM going, I pretty much bypassed the Debian package manager for the pure-java stuff I wanted to install like Tomcat, JBoss, etc. I think the debian package manager sucks for java stuff, but it's really convenient and comprehensive for non-java packages like Apache, Postgres, etc.

I have the linode64 and I setup the jboss on it. The performance was terrible when the JSP was compiled. It took more then one minute to access a JSP in JBOSS when it was first deployed. I know that it takes sometime to compile the JSP when it was accessed for the first time, but my whole goal of setting up a VPS is to play with JBOSS.

I guess linode 64 is below the recommended configuration for jboss (3.2.3). Do you have any tips how to improve the performance in the VPS environment? I don't really want to pay for a dedicated server.

I have a linode 64 and a 128, JBoss 3.2.3, tomcat5 configuration. I haven't been able to get JBoss working well on a linode 64. I use the /jmx-console built-in web app as a crude benchmark. I'm expecting jmx-console to be much slower than a page in typical web app I would deploy. I use a command like this to test:

time wget http://localhost:8080/jmx-console

On the 64 the best performance I got was about a minute to compile and 2-3 seconds to retrieve the page after that. On the Linode 128 i was getting about 28 seconds to compile and like 0.2 sec to access it after that, using the default config without tuning. The 128 performance seems good to me so I intend to use JBoss there. I've got JBoss and the Eclipse IDE on my laptop and they seem to work decently together. The cool thing about JBoss is you can run it on almost any platform for testing purposes and deploy the web apps to a production server.

About tuning.. I find the JVM -X settings are very key in low-memory situations. What I did is I ran the JVM with the -Xloggc: option to log the garbage collector activity. It turns out, in the default config on the 64 it was frequently spending like a minute doing garbage collection, and also it was using like 80 megs of memory which caused lots of swapping to occur. It seems that JBoss only really uses like 12 megs of heap in the default configuration, but it produces lots of garbage that fills up fast. So I adjusted the JVM settings for a max heap size of 24 megs (-Xmx24m) and told it to use the incremental garbage collector (supposed to reduce long garbage collection delays) and that helped a lot, according to the logs. There is a tradeoff with the heap that can be tricky. Lower heap sizes require more "urgent" (CPU-intensive) garbage collection but they use less disk swap on the host, while larger heap sizes cause less urgent garbage collection but use more disk swap which is slow and uses precious IO. On a Linode, I think lower heap is the way to go since IO seems to me much more scarce than CPU. There are probably some JBoss components I could disable to improve the speed, but I think I want most of em enabled. Oh and another thing to rememember is that certain JBoss components require tuning, I think one of the cache components triggers at specific memory usage levels, so those need to be tuned in conjunction with the heap size tuning.

Another important factor on Linode is the new I/O fairness bucket thing talked about on another post. JBoss and Java are real resource hogs, especially in a low RAM situation, and with the new IO bucket thing on the 2.4 kernels it seems that JBoss runs much slower. It mostly affects the startup time. I found that it took like 8 minutes for JBoss to start after the bucket thing and like 1 minute before. It didn't affect the response time at all though for my one-page test, which is a good sign, but it might affect the response time for higher, sustained loads. I'll have to do more testing for that. For me, the response times are key, not the compile times or startup times. I can test on my laptop (which is kinda like a baby dedicated server) and deploy to JBoss on Linode, without restarting it, but once my web apps are up I want my site visitors to get the pages back quickly.

Well, that's my two cents, if anybody has other experiences with JBoss/Linode I'd like to hear em.

JBoss will cream a 64. I run Tomcat on my 64 (Slackware) with IBM's Java 1.4.1 SDK. Performance isn't bad, but my memory is maxed out. I'm been contemplating dropping MySQL in favor of something more lightweight; that might save some RAM.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct