History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4825
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: P1 P1
Assignee: Lou Iorio
Reporter: John Sundman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Tomcat tweaking info to Deployer's Guide

Created: 28/Sep/07 12:51 PM   Updated: 22/Aug/08 05:33 AM
Component/s: Documentation
Affects Version/s: RingDing (4.1)
Fix Version/s: KrispyKremeDoc (4.2 Beta DGuide)

Time Tracking:
Not Specified

Severity: Minor
Runtime: N/A
Fix in hand: False


 Description  « Hide
From Mark D.:

There's a ton of information on the web about deploying web applications for large installations.

One of the many things that we worry about in LPS and WebTop is the number of file handles available to the tomcat process.

We in QA do this in a klugey way when we're load testing.

We first login as root and execute:
ulimit -n 150000

Then we run tomcat as normal.

This prepares the system to allow a single process to open large numbers of files. Since each concurrent connection represents at least one file handle, the system needs to allow many more than the defaults (usually 1024)

Also, the -Xmx and -Xms parameters can be important. We usually run (at minimum)

-Xmx512 -Xms256

# The -Xmx value determines the size of the heap to reserve at JVM initialization.
# The -Xms value is the space in memory that is committed to the VM at init. The JVM can grow to the size of -Xmx.


The too few file handles throws the following errors in catalina.out:
java.net.SocketException: Too many open files
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        at java.net.ServerSocket.implAccept(ServerSocket.java:450)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:408)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:71)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:595)
Jul 20, 2007 5:31:12 PM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket
WARNING: Reinitializing ServerSocket
Jul 20, 2007 5:31:12 PM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket
SEVERE: Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] ignored exception: java.net.SocketException: Too many open fil
es


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 28/Sep/07 01:03 PM
Depending on whether your server is dedicated to Tomcat, or you need to have Tomcat play nice with other processes on your server I would give Tomcat a max heap of at least half the RAM on the machine. And I believe the general recommendation is to set -Xms and -Xmx the same for servers.

We also use the `-server` option ourselves (this chooses a GC policy that is supposedly tuned for servers where the expectation is that the program will run for a long time).

And there are commercial Java Applet containers that may be a better choice for your particular application than Tomcat.

Lou Iorio - 22/Aug/08 05:33 AM
This information is already in the admin guide.