Webfaction doesn't have j2ee web servers by default. Users have to install it manually, by creating a "custom application listening on port".
I first started with Apache Tomcat, later ended with high memory usage than permitted for my account. My account's limit is 256MB RAM, however Tomcat was consuming around 500MB. Due to this reason, webfaction automatically terminates this high memory consuming process. I tried setting CATALINA_OPTS
with heap size restriction with no success.
$ ps -u arundhaj -o rss,size,etime,pid,command
RSS SZ ELAPSED PID COMMAND
524668 6118968 00:32 3630 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java -Djava.util.logging.config.file=/home/arund
1128 1060 00:00 4267 ps -u arundhaj -o rss,size,etime,pid,command
1740 792 11:16 23052 sshd: arundhaj@pts/16
1976 560 11:15 23073 -bash
Later I deployed Jetty. So far, I've hosted only one web application and the memory footage is considerably less.
$ ps -u arundhaj -o rss,size,etime,pid,command
RSS SZ ELAPSED PID COMMAND
1064 1056 00:01 18762 ps -u arundhaj -o rss,size,etime,pid,command
187588 2557360 10:57:50 21485 /usr/bin/java -Djetty.home=/home/arundhaj/webapps/jetty -Djava.io.tmpdir=/tmp -server -Xmx
1740 792 14:27 31562 sshd: arundhaj@pts/8
1892 424 14:26 31587 -bash
I still use the following option in jetty server startup, so that, I don't exceed the limit.
JAVA_OPTIONS+=("-server -Xmx256m -Djava.awt.headless=true")
Let us see, how long does this jetty server withstand this memory restriction.
If you know of any server lightweight than Tomcat and Jetty, please let me know.