Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:47:21+00:00 2026-06-12T09:47:21+00:00

I have Web application in Cent Os server created in JSP. After some time

  • 0

I have Web application in Cent Os server created in JSP. After some time the connections to mysql execeeds the limit and application could not work without restarting the mysql service.

Even I restarts the mysql and tomcat service some connections are allready created by mysql.

[root@localhost ~]# service tomcat restart

Shutting down Tomcat:
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.27
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.27/temp
Using JRE_HOME: /usr/java/jre1.6.0_10
Using CLASSPATH: /usr/local/apache-tomcat-7.0.27/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.27/bin/tomcat-juli.jar

Starting Tomcat:
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.27
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.27/temp
Using JRE_HOME: /usr/java/jre1.6.0_10
Using CLASSPATH: /usr/local/apache-tomcat-7.0.27/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.27/bin/tomcat-juli.jar

[root@localhost ~]#

service mysql restart

Shutting down MySQL. [ OK ]

Starting MySQL…… [ OK ]

[root@localhost ~]# netstat | grep mysql | wc -l

180

As shown above it shows 180 connections all ready running and the connections are like

[root@localhost ~]# netstat | grep mysql

tcp 1 0 localhost.localdomain:49058 localhost.localdomain:mysql CLOSE_WAIT
tcp 1 0 localhost.localdomain:49061 localhost.localdomain:mysql CLOSE_WAIT
tcp 1 0 localhost.localdomain:49060 localhost.localdomain:mysql CLOSE_WAIT
tcp 1 0 localhost.localdomain:49063 localhost.localdomain:mysql CLOSE_WAIT
tcp 1 0 localhost.localdomain:49062 localhost.localdomain:mysql CLOSE_WAIT

I have checked my sql files three times and there is no connections remained unclosed

Please give me the solution…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:47:22+00:00Added an answer on June 12, 2026 at 9:47 am

    CLOSE_WAIT tcp socket state means that connection is in process if being closed, waiting for application to execute close() method. You should always execute close() method after finishing the usage of some resource (connection to database, file IO, network connections, etc).

    You can check this example how to correctly handle your database connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web application that is generating some 3-5 parallel threads every five
We have web-application with REST interface. Is there some tools to test it?
I have web application deployed on websphere application server 7.0. User logins using /j_security_check.
I have web application that runs on tomcat. I would like to put some
I have a web-application: ExtJs frontend - EntityFramework + SQL Server as a backend.
I have web application (asp.net) located on web server. I need to send email
I have Web application. I use Struts2. And I have little JSP: <%@ taglib
I have web application that in some pages I use Ms Ajax (Script Manager,Update
I have web application developed using JSP and struts. I am just looking out
I have created web application where I want to highlight the menu selected. Below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.