iWiz ShareBase

IT Specialist 윤태현의 iWiz ShareBase는 IT뿐 아니라 각종 잡다한 지식들을 함께 나누는 지식공유 커뮤니티입니다.

iWiz,ShareBase,윤태현,Java,JSP,EJB,IT,정보기술,웹프로그래밍,PHP,ASP,DBMS,MySQL,서버,네트워크,server,network,WAS,웹애플리케이션,블로그,blog,웹서버,DB,오라클,oracle,mysql,JRun,웹로직,톰캣,tomcat,아파치,자동차,EF쏘나타,로또 6/45

갤러리 Pixelgrapher.com | 로또 6/45 번호생성 및 통계 데이터 | 전체기사보기 | 전체글 #1 | 전체글 #2 | 전체글 #3 | 전체글 #4 | 전체글 #5 | 전체글 #6 | 전체글 #7 | 전체글 #8 | 전체글 #9 | 전체글 #10 |
HOME iWiz
ShareBase
Remember 0523 & 0818
지식은 나눌수록 커집니다 - iWiz's ShareBase
웹프로그래밍(기타) PHP, ASP, Perl, CGI 등 각종 웹프로그래밍에 관한 자료들입니다.


  iWiz(2004-01-04 22:38:20, Hit : 13015, Vote : 37
 http://www.wz.pe.kr

Optimizing the web application environment


Optimizing the web application environment

This section provides some ideas for improving the operating environment of JRun for your web application.

Optimizing session settings

Session objects are stored in memory on the server and referenced with a session ID that is passed back and forth between the client and the server. Because they are stored in memory, each session uses a small amount of system resources.

The following table describes session settings that you can change to reduce resource load:
Setting
Description
Maximum Sessions
The number of sessions JRun caches in memory before swapping them out to disk. To prevent JRun from serializing session objects, increase the number of sessions you cache in memory.
You set this value in the jrun-web.xml file.
Maximum Inactive Interval (MaxAge)
The amount of time before JRun destroys an inactive session object. The default is 1800 seconds (30 minutes). Decrease this time to clear unused sessions sooner.
If you are using cookies as the state-management mechanism, you can set the maximum age programmatically (with the cookie.setMaxAge method) or declaratively, in the jrun-web.xml file.

For more information on changing session settings, see "Working with sessions".

Disabling hot deployment

The hot deploy feature automatically restarts (redeploys) a running web component upon detection of changes to the component structure.

When hot deploy is enabled, JRun periodically checks the date/time stamps of all the resources to determine if the files have changed. This constant cycling uses up a small amount of system resources.

To disable hot deploy, add the following attribute to the jrun.deployment.DeployerService service in the jrun_root/servers/server_name/SERVER-INF/jrun.xml file:

<attribute name="hotDeploy">false</attribute>

Note:   You must always disable hot deployment on production servers.

Managing the thread pool

Part of configuring the connector between JRun and an external web server is optimizing the concurrency settings. Concurrency defines how HTTP requests are pooled and distributed. By changing these settings, you can limit the number of threads and requests that each JRun server processes. In effect, you can throttle the traffic for that JRun server.

If, for example, the average response time of your web application is slow because of a three-step RMI-CORBA-database transaction, then your site might need to queue up many more requests to maintain throughput without refusing any new requests. In this case, you should increase the maximum concurrent requests to a value greater than the number of expected requests. The maximum concurrent requests setting acts as a safety valve for resources.

Note:   Remember that "concurrent requests" and "concurrent users" are two distinct concepts.A website that must support 1000 concurrent users does not also need to support 1000 concurrent requests, since 1000 users will likely create only a fraction of that number of requests at one time.

The following table describes the settings with which you can configure concurrency settings for the connection to your web server:
Name
Description
Default
ActiveHandlerThreads
The initial size of the handler thread pool.
10
Backlog
The number of concurrent requests that are accepted before new requests are denied. (Previously known as Maximum Concurrent Requests.)
1000
MaxHandlerThreads
The number of concurrent requests that are accepted before new requests are queued.
If your application requires more than the default concurrent users, and you have enough CPU power, you can increase the MaxHandlerThreads value to improve performance.
20
MinHandlerThreads
The minimum number of handler threads in the pool.
In an environment where your website experiences spikes in traffic, set the MinHandlerThreads value higher so that a group of threads do not have to be created during a spike.
You can also set MinHandlerThreads value to the expected steady state load of concurrent requests. For example, if a website has 80 concurrent requests at all times, then set the MinHandlerThreads to 80.
1
Timeout
The idle thread time out, which is the number of seconds that threads remain idle before being destroyed.
300

To change concurrency settings, add the properties to the appropriate service in the jrun.xml file with the new values, as shown in the following example:

<service class="jrun.servlet.http.WebService" name="WebService">
 ...
 <attribute name="minHandlerThreads">80</attribute>
 ...
</service>

To edit the JRun web server's settings, change the attributes of the WebService. To edit the external web server connector settings, change the attributes of the ProxyService.

Note:   Before changing any of the default JRun concurrency settings, be sure that the traffic patterns are truly observable. Arbitrarily changing settings can waste resources. For more information on load-testing web applications, see the resources in "Other resources".

Trying different JVMs

Reusing and caching objects saves memory and CPU cycles associated with JVM garbage collection and object allocation. Object allocation takes CPU cycles and memory. Garbage collecting unreferenced objects requires suspension of all other threads in the JVM while the garbage collector threads run, which slows down an application.

Choosing a JVM can make a big difference in performance of your web applications. Sun Microsystems' HotSpot Server VM and Appeal's JRockit use advanced algorithms like generational garbage collection, which reduce the runtime duration of the garbage collection threads.

You should run load tests under different environments to determine which operating system/JVM combination is best for your particular web application.

Increasing the heap size of JVMs

Changing the memory settings of your JVM can increase performance of your JRun server. Before you make adjustments, though, you must know how much memory your application requires. Perform a load test on your application and display the heap size.

Set the JVM's minimum (or initial) heap size to the highest value (memory consumption) during load testing. Also, set the maximum heap size value to something less than the total memory available, minus other required resources, but choose the highest possible value. If the maximum heap size is set to the default value in the JDK that you are using (usually 128MB), but you exceed the maximum value, "OutOfMemory" errors can occur.

To set the maximum heap size value, edit the Max Heap Size (MB) field on the JVM Settings panel of the JMC. You can change other settings by adding command-line arguments to the VM Arguments field on the same panel.

The following table describes some possible arguments. These arguments depend on which JVM you are using.
Argument
Description

-Xms<value>

Initial (minimum) value of the Java heap size.

-Xmx<value>

Maximum value of the Java heap size.

-Xss<value>

Value of the Java thread stack size.

For optimal performance, set the minimum and maximum heap size to the same value. This eliminates the need for incremental increases by the JRun process.

For more information, see your JVM's documentation.

Reducing logging activities

While log files are useful tools for debugging and tracking usage of your web applications, the overhead required to generate substantial log files can be noticeable. For this reason, consider turning off logging in your production applications and instead using your web server's logs as a source of information.

To turn off logging in JRun, set the LoggerService attributes to false in the /jrun_root/servers/server_name/SERVER-INF/jrun.xml file, as shown in the following example:

...
<service class="jrunx.logger.LoggerService" name="LoggerService">
...
  <attribute name="errorEnabled">false</attribute>
  <attribute name="warningEnabled">false</attribute>
  <attribute name="infoEnabled">false</attribute>
  <attribute name="debugEnabled">false</attribute>
  <attribute name="metricsEnabled">false</attribute>
...
</service>
...

Verbose database logging is off by default. If you turned it on while developing your web application, turn it off by editing the appropriate data source in the jrun-resources.xml file and setting the debugging element's value to false.

* iWiz님에 의해서 게시물 이동되었습니다 (2010-02-03 16:57)



62   mod_throttle 모듈을 이용한 사용자 트래픽 제어  iWiz 2006/06/22 8911 0
61   Tomcat-Apache using JK2 connector  iWiz 2004/03/21 6503 41
60   RedHat 9.0에서의 JRun JSP 컴파일러의 문제점  iWiz 2004/01/04 5382 50
59   RedHat 9.0에서의 JRun-Apache 커넥터의 문제점  iWiz 2004/01/04 5064 48
58   JRun 4.0의 튜닝 관련 옵션  iWiz 2004/01/04 5811 68
57   JRun 4.0의 Activity 모니터링 방법  iWiz 2004/01/04 4786 57
56   JRun4.0: DataSource 커넥션풀 관련 옵션 [4]  iWiz 2004/01/04 6532 46
55   JRun에서 JSP 컴파일시 java 파일 생성하기  iWiz 2004/01/04 7916 63
54   JRun의 실제 서비스 운영시 고려사항  iWiz 2004/01/04 6194 44
53   수정된 인터넷 익스플로러에서 상호작용 ActiveX 컨트롤 활성화 가이드  iWiz 2006/03/03 8226 4
52   HTML 특수기호 엔터티(Entity) 테이블 [2]  iWiz 2006/03/03 13887 2
51   웹사이트의 새로운 혁명 Ajax [13]  iWiz 2005/11/22 5724 6
50   MSN 메신저 친구 자동등록 스크립트  iWiz 2004/10/12 6069 35
49   JavaScript MD5 해쉬 생성 함수  iWiz 2004/01/07 8886 35
48   JavaScript로 만든 진법변환 및 보수계산기 [4]  iWiz 2004/01/04 157949 51

1 [2][3][4][5]
 

Copyright 1999-2023 Zeroboard / skin by zero
iWiz ShareBase, ⓒCopyleft by iWiz.  For more information contact .
본 웹사이트에 게시된 이메일 주소가 전자우편 수집 프로그램이나 그 밖의 기술적 장치를 이용하여 무단으로 수집되는 것을 거부하며, 이를 위반시에는 정보통신망법에 의해 형사처벌됨을 유념하시기 바랍니다. [게시일 2004. 1. 31]