2011년 11월 25일 금요일

Performance Tuning the JVM for Running Tomcat


First, Mikusa walks us through the key configuration options we need to understand while performance tuning the JVM:

  • -Xms and ?Xmx. Used to define the size of the heap used by the JVM, -Xms sets the initial size of the heap and -Xmx sets the maximum size of the heap. Specific values depend on the application.For Tomcat, it is recommended that ?xms and ?xmx be set to the same value. Referred to as a fully committed heap, this will instruct the JVM to create a heap that is initially at its maximum size and prevent several full garbage collections from occurring as the heap expands to its maximum size. Remember, max heap equals 4 or 5 times the minimum heap.

  • -XX:PermSize and -XX:MaxPermSize. Used to define the size of the permanent generation space,it is also recommended that these be set to the same value. This will instruct the JVM to create the permanent generation so that it is initially at its maximum size and prevent possible full garbage collections from occurring as the permanent generation expands to its maximum size.

  • -Xss. Used to define the size of the stack for each thread in the JVM. The optimum value varies across applications however, in most cases, the default value used by the JVM is too large. Try lowering the value, starting with 128k, saving memory and increasing the number of threads that can be run on a system. Run Tomcat and look for a StackOverFlow exception in the logs. If you see the exception, then gradually increase the value and restart Tomcat. When the exceptions disappear, you have found the minimal value which works for your deployment.

  • -server. Used to select the Java HotSpot Server VM when running 32-bit Windows. This will instruct the VM that it is running in a server environment and the default configurations will be changed accordingly. 32-bit Solaris and 32-bit Linux installations with two or more CPU's and 2GB or more of RAM will enable this option by default. In addition, all 64-bit OS's have this option enabled by default as there is no 64-bit client VM.

댓글 없음:

댓글 쓰기

ETL 솔루션 환경

ETL 솔루션 환경 하둡은 대용량 데이터를 값싸고 빠르게 분석할 수 있는 길을 만들어줬다. 통계분석 엔진인 “R”역시 하둡 못지 않게 관심을 받고 있다. 빅데이터 역시 데이터라는 점을 볼때 분산처리와 분석 그 이전에 데이터 품질 등 데이...