Tag Archives: rimuhosting

How to pick a good web hosting company for Java webapp

I currently use Dreamhost for my own company “JustProposed.com” that is powered by typical LAMP solution. It is a great shared hosting solution but it doesn’t support website powered by Java. If you have Java website, I suggest you to try a web hosting company that provides you VPS (Virtual Private Server) solution. VPS occupies a middle ground between a dedicated server and regular shared hosting. You get the features of dedicated hosting in a shared environment. In other words, your virtual server runs on one of host servers. The host server runs a number of virtual servers.  Each virtual server shares the host server’s memory, CPU, Internet connection and other resources. No one VPS can monopolize resources.  Each VPS gets a guaranteed share of the server CPU, disk IO and network.

Before you pick a good web hosting company for your java webapp, you better get familiar with the system need of your webapp first. There are some interesting topics that you may encounter:

  1. Shared JVM vs Private JVM – The two biggest problems with shared Java hosting are memory leaks and security. If someone has a memory leak or code that is a high user of memory in a shared environment, all of the people sharing that JVM suffer the same memory problems.  Apart from that, it is not secure. Therefore, you don’t want to share the same JVM with other users although it is cheaper. One more disadvantage of Shared JVM is that you cannot restart the Tomcat as you wish.
  2. PermGen space (default = 64MB) is used for things that do not change (or change often). e.g. Java classes.  So often large, complex apps will need lots of PermGen space. Similarly if you are doing frequent war/ear/jar deployments to running servers like Tomcat or JBoss you may need to issue a server restart after a few deploys or increase your PermGen space. To increase the PermGen space use something like: -XX:MaxPermSize=128m
  3. Heap size setting – Java has a couple of settings that help control how much memory it uses:
    • -Xms sets the minimum memory heap size.
    • -Xmx sets the maximum memory heap size. When setting the -Xmx setting you should consider a few things…  -Xmx has to be enough for you to run your app.  If it is set too low then you may get Java OutOfMemory exceptions (even when there is sufficient spare memory on the server).
    • We typically specify the same amount of memory for both flags (-Xms and -Xmx) to force the server to use all the allocated memory from startup. This way, the JVM wouldn’t need to dynamically change the heap size at runtime, which is a leading cause of JVM instability.
    • If you don’t specify a memory size in the JVM startup flags, the JVM would limit the heap memory to 64MB (512MB on Linux), no matter how much physical memory you have on the server!
    • For 64-bit servers, make sure that you run a 64-bit JVM on top of a 64-bit operating system to take advantage of all RAM on the server. Otherwise, the JVM would only be able to utilize 2GB or less of memory space. 64-bit JVMs are typically only available for JDK 5.0.
    • Suggested memory size: PermGen + Max Heap = 256MB. Of course, the more you get the better! :smile:
  4. Garbage collection (GC)With a large heap memory, the garbage collection (GC) operation could become a major performance bottleneck. It could take more than ten seconds for the GC to sweep through a multiple gigabyte heap.
    • Single-threaded vs concurrent GC – In JDK 1.3 and earlier, GC is a single threaded operation, which stops all other tasks in the JVM. That not only causes long and unpredictable pauses in the application, but it also results in very poor performance on multi-CPU computers since all other CPUs must wait in idle while one CPU is running at 100% to free up the heap memory space. It is crucial that we select a JDK 1.4+ JVM that supports parallel and concurrent GC operations. Actually, the concurrent GC implementation in the JDK 1.4 series of JVMs is not very stable. So, we strongly recommend you upgrade to JDK 5.0.
    • Pick a good GC algorithms – Parallel GC free up memory faster but longer pause. Concurrent GC has shorter pause but doesn’t free up all memory at once.
  5. How to have your tomcat be available at port 80
  6. More on Java system tuning on multi-core server

Below are some of the great VPS options on the Net:

RimuHosting.com provides Xen-based VPS. Xen is the virtualization technology that Amazon use for EC2.

  • Guaranteed 99.9% uptime
  • They target at most, 8 customers per CPU core with 16% usage.
  • The host server is 2U Supermicro with 32GB of memory, 8 2.4Ghz Xeon CPU cores and 4TB of disk space.
  • You can get 256MB memory and 4GB disk space allocated for about $30.
  • Great how to wiki page


SliceHost.com also provides Xen-based VPS.

  • Guaranteed 99.9% uptime
  • The host server is in 16GB memory, 64 bits, quad-core CPU with 8+ Ghz. RAID-10 disk storage with Gigabit network.
  • You can get 256MB memory, 10GB disk space and 100GB bandwidth for about $20.
  • No contracts, no setup fees.
  • Great how to wikipage

WestHost.com that costs $10 per month.

  • Guaranteed 99.9% uptime
  • Lots of hard drive space but no guaranteed on memory allocation.

http://www.perfectblogger.com/2007/10/why-i-think-slicehost-is-the-best/

How to get SVN service for FREE?

If you are using website is in php, I believe Dreamhost is enough for you. Apart from using Dreamhost as web hosting, I also use it as my SVN repository. I have a project named “Justproposed.com” that I want to work in collaboration with my partners. I want to use SVN that I found very helpful at work. However, I don’t want to pay too much to do that. I wonder any of the web hosting company on the Net that provides this service. So, I can pay my regular web hosting fee and get this extra service for FREE (It is practically free if the web hosting company you pick gives you tons of disk space). I have searched through different postings and feedbacks and eventually found “Dreamhost” that gives me exactly what I want.

DreamHost

If you use “SOLUTIONHACKER” as code, you will get your first year FREE as well. Apart from the great service they provide, there are many supporters on the Net to help each other. Here is a good article that shows you how to set up your first SVN repository on Dreamhost. Follow this to get started your project in a cheap way!

http://www.jtbullitt.com/projects/tech/svn-for-website-development

Leave a comment Continue Reading →