Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

bagaimana cara memeriksa penyatuan koneksi HikariCP berfungsi atau tidak di Jawa?

Pertama, konfigurasi tidak konsisten karena maximum

hibernate.hikari.maximumPoolSize=10
hibernate.hikari.minimumIdle=10

Jika kumpulan berfungsi, Anda akan melihat 10 koneksi ESTABLISHED ke port 3306 (atau mssql 1433 dalam contoh di bawah).

lsof -nP -i :1433 -sTCP:ESTABLISHED
COMMAND  PID       USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
java    1596 lmc  260u  IPv6 1624799      0t0  TCP 127.0.0.1:43022->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  265u  IPv6 1626072      0t0  TCP 127.0.0.1:43026->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  266u  IPv6 1630933      0t0  TCP 127.0.0.1:43030->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  267u  IPv6 1631705      0t0  TCP 127.0.0.1:43034->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  268u  IPv6 1632268      0t0  TCP 127.0.0.1:43038->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  269u  IPv6 1632273      0t0  TCP 127.0.0.1:43042->127.0.0.1:1433 (ESTABLISHED)
java    1596 lmc  270u  IPv6 1632278      0t0  TCP 127.0.0.1:43046->127.0.0.1:1433 (ESTABLISHED)

Menggunakan ss (statistik soket)

ss -46 -np state established dport = :1433 | grep 'java' | sort -r -k 3,3 | nl
     1  tcp    0       0          [::ffff:127.0.0.1]:43158     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=273))                                               
     2  tcp    0       0          [::ffff:127.0.0.1]:43154     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=272))                                               
     3  tcp    0       0          [::ffff:127.0.0.1]:43150     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=271))                                               
     4  tcp    0       0          [::ffff:127.0.0.1]:43142     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=270))                                               
     5  tcp    0       0          [::ffff:127.0.0.1]:43138     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=269))                                               
     6  tcp    0       0          [::ffff:127.0.0.1]:43134     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=268))                                               
     7  tcp    0       0          [::ffff:127.0.0.1]:43130     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=267))                                               
     8  tcp    0       0          [::ffff:127.0.0.1]:43126     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=266))                                               
     9  tcp    0       0          [::ffff:127.0.0.1]:43122     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=265))                                               
    10  tcp    0       0          [::ffff:127.0.0.1]:43118     [::ffff:127.0.0.1]:1433   users:(("java",pid=1596,fd=260))

Menggunakan netstat (tidak digunakan lagi di beberapa distro dan digantikan dengan ss )

netstat -ant | grep 3306
tcp        0      0 127.0.0.1:41722     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41730     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41728     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41726     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41716     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41732     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41720     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41736     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41718     127.0.0.1:3306      ESTABLISHED 
tcp        0      0 127.0.0.1:41724     127.0.0.1:3306      ESTABLISHED


  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Membangun Sistem Newsletter Dengan PHP dan MySQL

  2. PHP strtotime():tanggal menunjukkan '1970-01-01 ' setelah konversi

  3. MySQL - Fungsi CASE vs IF Statement vs IF

  4. cara menghitung kesamaan antara dua string di MYSQL

  5. Cara tercepat untuk mengimpor file CSV besar ke MySql menggunakan MySql CLI