Here's the thing: I have an application server, called A, and a DB server, called B.
On B(DB), when I run netstat -ntp | grep 'A's IP' | wc -l
, I see over 400 TCP connections.
And when I connected to MySQL using MySQL client, and run select count(*) from processlist where host like 'A's IP%'
, I see over 400 results too, so it seems that both MySQL & OS agree there are over 400 open connections to A.
However, when I logon to A, run netstat -ntp | grep 'B's IP' | wc -l
, I see only over 100 TCP connections.
So how can this happen? Am I using netstat
wrong, or what? I just don't see why two hosts disagree on how many TCP connections that are between them.
Quick update:
We actually have 6 different projects on A(Some are Rails 3.2, Some are Rails 2.3), including redmine. I grab the show processlist
result on B, comparing it to netstat -ntp
on A, found out that the unmatched connections on B is from different projects, including redmine. So I'm basically ruling out the application code, any wild guesses?
PS: Both OS is CentOS 5.4, MySQL is Percona 5.1.57-rel12.8-log