Re: Refreshing webapps slows server

2017-08-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Suvendu,

On 8/23/17 3:09 PM, Suvendu Sekhar Mondal wrote:
>> On Aug 23, 2017 11:40 PM, "Caldarale, Charles R"
>>  wrote:
>> 
>>> From: Jerry Malcolm [mailto:techst...@malcolms.com] Subject:
>>> Refreshing webapps slows server
>> 
>>> I have a very weird situation.
>> 
>> Actually, it's fairly common.
>> 
>>> This is somewhat circumstantial.  But TC will run fine for days
>>> and never hits OutofMemory situations.  But as soon as I start
>>> replacing webapp jar files, things start going bad.  So it
>>> appears that the issue is caused by replacing jar files.
>> 
>> This sounds like a classic case of retaining references to now
>> obsolete classes or instances thereof.  Take a look at the Wiki: 
>> https://wiki.apache.org/tomcat/FAQ/Memory especially, the link to
>> "classloaders are not being garbage collected" and these: 
>> https://wiki.apache.org/tomcat/OutOfMemory 
>> https://wiki.apache.org/tomcat/MemoryLeakProtection
>> 
>> - Chuck
> 
> I agree with Chuck.
> 
> Jerry, In this type of situation, if I were you, I would have tried
> to found the root cause of OutOfMemory and fix it. Because if you
> are using same method to apply your new code to the production
> server and if this problem remains, there is high chance your prod
> server will also suffer from OutOfMemory - sooner or later. I will
> suggest you to examine those heap dumps using your favourite tool.
> I am pretty sure you will get solid clue to solve this problem.

https://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-6
0mins.pdf

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZneERAAoJEBzwKT+lPKRYtSkP/jflIfRU2OrAR6vgab13OnnI
C/L9YxZcF+NZuIWGDXAFMCHseuN0O2DzSaZTc5GoNnju7ncXKaoNYUK4btypeO5Y
nqAatW8HBt0PXuAmkbWZM/o9ZwP3t3AYuSC/qpW+OewkWi7mqWaDI6n60PEeD6aT
NNiEZtae/UIoXIuvqwlY0d0SYce305tMCAX7v/ZeO0ApXvU5M4WL81pdXu49cKoR
JDdmDF8OSyVc8/wGk40YXBKxxyxqw3r0MUYURSX1d88Fw4uVVbo6MsLYXobkp07y
DhW9SPu95MePYeI3z2gGjnEJmZv56ZefhvDRvXx2SeYaHTdtZnbfnnvkVwIE52vx
7BWSEu8HtV43q2ZN2ijwShN1Yls3stCM8bDtDcl5/FlX/m8j8OKmGKjYd3kn8dBV
9QgvMLdt/xHJIPDHAxbYU645wdH90+0hhR2uBdlK5WZpNEcRpJ7nIq59Jm9IX8sN
OBlcxr0dreqdIZaZCVXn9KpM0Uuh3/jBta7W71Wb3/FEribr8OXQDzSNhmvpbh3f
ECEHkbvCGwpO4RihOpxLboM+ZVYiGmpBnmbohAo/jeZn5uJsiI/yVdDtxzbkoOhG
cBDQx1p5eCDy0kkO+c5lw2Sk+PTobT1mGibt5L3C/2gTETKdDZ6OzQzMu3eg637+
aXUf8aCXmrrjuPk9egtp
=LFn6
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Refreshing webapps slows server

2017-08-23 Thread Suvendu Sekhar Mondal
On Aug 23, 2017 11:40 PM, "Caldarale, Charles R" 
wrote:

> From: Jerry Malcolm [mailto:techst...@malcolms.com]
> Subject: Refreshing webapps slows server

> I have a very weird situation.

Actually, it's fairly common.

> This is somewhat circumstantial.  But TC will run fine for days and
> never hits OutofMemory situations.  But as soon as I start replacing
> webapp jar files, things start going bad.  So it appears that the issue
> is caused by replacing jar files.

This sounds like a classic case of retaining references to now obsolete
classes or instances thereof.  Take a look at the Wiki:
https://wiki.apache.org/tomcat/FAQ/Memory
especially, the link to "classloaders are not being garbage collected" and
these:
https://wiki.apache.org/tomcat/OutOfMemory
https://wiki.apache.org/tomcat/MemoryLeakProtection

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


I agree with Chuck.

Jerry,
In this type of situation, if I were you, I would have tried to found the
root cause of OutOfMemory and fix it. Because if you are using same method
to apply your new code to the production server and if this problem
remains, there is high chance your prod server will also suffer from
OutOfMemory
- sooner or later. I will suggest you to examine those heap dumps using
your favourite tool. I am pretty sure you will get solid clue to solve this
problem.

Thanks!
Suvendu


RE: Refreshing webapps slows server

2017-08-23 Thread Caldarale, Charles R
> From: Jerry Malcolm [mailto:techst...@malcolms.com] 
> Subject: Refreshing webapps slows server

> I have a very weird situation.

Actually, it's fairly common.

> This is somewhat circumstantial.  But TC will run fine for days and 
> never hits OutofMemory situations.  But as soon as I start replacing 
> webapp jar files, things start going bad.  So it appears that the issue 
> is caused by replacing jar files.

This sounds like a classic case of retaining references to now obsolete
classes or instances thereof.  Take a look at the Wiki:
https://wiki.apache.org/tomcat/FAQ/Memory
especially, the link to "classloaders are not being garbage collected" and
these:
https://wiki.apache.org/tomcat/OutOfMemory
https://wiki.apache.org/tomcat/MemoryLeakProtection

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.



smime.p7s
Description: S/MIME cryptographic signature


Re: Refreshing webapps slows server

2017-08-23 Thread Mark Eggers
Jerry,

On 8/23/2017 9:29 AM, Jerry Malcolm wrote:
> I have a very weird situation.  I have a  staging server and a
> production server running on the same instance of TC (8.0).  When I'm
> doing development and testing on the staging server, I'm often replacing
> jar files and JSPs in the various webapps running on the staging server
> (I don't reupload full WAR files each time... just incremental jar/jsp
> changes).  TC recognizes the updated jar files and reloads.  Both
> production and development sites continue to function (including using
> the new updated jars, etc).  But over time, Tomcat starts getting slower
> and slower in response time, sometimes hitting an OutofMemory error. 
> Response time on a request goes from milliseconds to 20+ seconds. 
> Bouncing TC fixes everything.
> 
> This is somewhat circumstantial.  But TC will run fine for days and
> never hits OutofMemory situations.  But as soon as I start replacing
> webapp jar files, things start going bad.  So it appears that the issue
> is caused by replacing jar files.
> 
> Is this a recognized situation?  I don't want to have to bounce the
> production site every time I refresh the staging code.  But I need to
> test updates on the staging site on the same server.  Are there
> alternatives to keep this slowdown from occurring? Suggestions?
> 
> Thx.
> 
> Jerry

What version of Java are you running? What type of out of memory error
are you getting?

I don't know how big your WAR files are, so the following may not be an
option.

1. Use versioned WAR files
2. Use sessions in your application with reasonable session-timeout
3. Configure server.xml for undeployOldVersions

See the following:

http://tomcat.apache.org/tomcat-8.0-doc/config/host.html#Common_Attributes

https://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Parallel_deployment

. . . just my two cents
/mde/



signature.asc
Description: OpenPGP digital signature