سؤال

I am facing a problem that is burning my brain. I have an amazon ec2 instance that runs Linux AMI, I installed tomcat7 and I am deploying my webservice in it. This webservice connects itself with an amazon RDS instance where I have my mysql (that I use to validate user and password). When I start my tomcat7 service everything works great, after one hour I can't log in into my system.

If i restart the tomcat7 service, everything works again. But why?

I really don't know where is the problem. I can connect to my database directly from my project in eclipse, and via command line.

I don't know why if I restart the service, my webservice works again. I know that the service hasn't stoped, because I can access the login page of my webapp.

I really appreciate any kind of help,

Rodrigo Araujo.

ps: Last week, everything was working just fine.

هل كانت مفيدة؟

المحلول

I've seen such behavior before, it is probably tomcat and not ec2. Check the following:

1- Your threading configuration (maxThreads and acceptCount). I've seen this behavior using the blocking connector when currentThreadsBusy > maxThreads. Check that you have enough threads or use the non-blocking (nio) connector.

2- Check that your connection pool can reconnect lost connections automatically (autoReconnect=true in the jdbc url), your threads might be waiting db io on lost connections.

Anyway, your ec2 instance is probably still working...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top