PostgreSQL 三种关库模式

devtools/2024/11/28 20:21:45/

PostgreSQL 三种关库模式

基础信息
OS版本:Red Hat Enterprise Linux Server release 7.9 (Maipo)
DB版本:16.2
pg软件目录:/home/pg16/soft
pg数据目录:/home/pg16/data
端口:5777

PostgreSQL 提供了三种关库模式,分别是 Smart ShutdownFast ShutdownImmediate Shutdown。以下是每种模式的详细说明:

  1. Smart Shutdown
    • 这种模式下,数据库会等待所有活跃的客户端连接断开后才会停止。
    • 如果用户一直不断开连接,服务器将无法停止。
    • 使用 pg_ctl 命令的示例如下:
      pg_ctl stop -m smart
      

输出日志

2024-11-27 06:01:14.149 PST [127700] DEBUG:  postmaster received shutdown request signal
2024-11-27 06:01:14.149 PST [127700] LOG:  received smart shutdown request
2024-11-27 06:01:14.150 PST [127700] DEBUG:  sending signal 15 to process 127708
2024-11-27 06:01:14.150 PST [127708] DEBUG:  logical replication launcher shutting down
2024-11-27 06:01:14.150 PST [127706] DEBUG:  autovacuum launcher shutting down
2024-11-27 06:01:14.150 PST [127708] DEBUG:  shmem_exit(1): 5 before_shmem_exit callbacks to make
2024-11-27 06:01:14.150 PST [127706] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:01:14.150 PST [127708] DEBUG:  shmem_exit(1): 6 on_shmem_exit callbacks to make
2024-11-27 06:01:14.150 PST [127708] DEBUG:  proc_exit(1): 1 callbacks to make
2024-11-27 06:01:14.150 PST [127708] DEBUG:  exit(1)
2024-11-27 06:01:14.150 PST [127708] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.150 PST [127708] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.150 PST [127708] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.150 PST [127705] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127705] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127705] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:01:14.151 PST [127705] DEBUG:  exit(0)
2024-11-27 06:01:14.151 PST [127705] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127705] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127705] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.151 PST [127706] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127706] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:01:14.151 PST [127706] DEBUG:  exit(0)
2024-11-27 06:01:14.151 PST [127706] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127706] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127706] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.151 PST [127700] DEBUG:  reaping dead processes
2024-11-27 06:01:14.151 PST [127700] LOG:  background worker "logical replication launcher" (PID 127708) exited with exit code 1
2024-11-27 06:01:14.151 PST [127703] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127703] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127703] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:01:14.151 PST [127703] DEBUG:  exit(0)
2024-11-27 06:01:14.151 PST [127703] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127703] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.151 PST [127703] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.151 PST [127700] DEBUG:  reaping dead processes
2024-11-27 06:01:14.152 PST [127700] DEBUG:  reaping dead processes
2024-11-27 06:01:14.152 PST [127702] LOG:  shutting down
2024-11-27 06:01:14.178 PST [127707] DEBUG:  executing archive command "test ! -f /home/pg16/archivelog/00000001000000040000002F && cp pg_wal/00000001000000040000002F /home/pg16/archivelog/00000001000000040000002F"
2024-11-27 06:01:14.178 PST [127702] LOG:  checkpoint starting: shutdown immediate
2024-11-27 06:01:14.178 PST [127702] DEBUG:  performing replication slot checkpoint
2024-11-27 06:01:14.181 PST [127702] DEBUG:  attempting to remove WAL segments older than log file 00000000000000040000002F
2024-11-27 06:01:14.182 PST [127702] DEBUG:  SlruScanDirectory invoking callback on pg_subtrans/005C
2024-11-27 06:01:14.182 PST [127702] LOG:  checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.004 s; sync files=0, longest=0.000 s, average=0.000 s; distance=16383 kB, estimate=16383 kB; lsn=4/30000028, redo lsn=4/30000028
2024-11-27 06:01:14.182 PST [127702] DEBUG:  shmem_exit(0): 5 before_shmem_exit callbacks to make
2024-11-27 06:01:14.182 PST [127702] DEBUG:  writing stats file "pg_stat/pgstat.stat"
2024-11-27 06:01:14.182 PST [127702] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:01:14.182 PST [127702] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:01:14.182 PST [127702] DEBUG:  exit(0)
2024-11-27 06:01:14.182 PST [127702] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.182 PST [127702] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.182 PST [127702] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.183 PST [127700] DEBUG:  reaping dead processes
2024-11-27 06:01:14.196 PST [127707] DEBUG:  archived write-ahead log file "00000001000000040000002F"
2024-11-27 06:01:14.197 PST [127707] DEBUG:  shmem_exit(0): 5 before_shmem_exit callbacks to make
2024-11-27 06:01:14.197 PST [127707] DEBUG:  archiver process shutting down
2024-11-27 06:01:14.197 PST [127707] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:01:14.197 PST [127707] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:01:14.197 PST [127707] DEBUG:  exit(0)
2024-11-27 06:01:14.197 PST [127707] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.197 PST [127707] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.197 PST [127707] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.202 PST [127700] DEBUG:  reaping dead processes
2024-11-27 06:01:14.202 PST [127700] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.202 PST [127700] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:01:14.205 PST [127700] DEBUG:  cleaning up orphaned dynamic shared memory with ID 210471318
2024-11-27 06:01:14.205 PST [127700] DEBUG:  cleaning up dynamic shared memory control segment with ID 4077101978
2024-11-27 06:01:14.205 PST [127700] DEBUG:  proc_exit(0): 2 callbacks to make
2024-11-27 06:01:14.206 PST [127700] LOG:  database system is shut down
2024-11-27 06:01:14.206 PST [127700] DEBUG:  exit(0)
2024-11-27 06:01:14.206 PST [127700] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.206 PST [127700] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.206 PST [127700] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:01:14.207 PST [127701] DEBUG:  logger shutting down
2024-11-27 06:01:14.207 PST [127701] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.207 PST [127701] DEBUG:  shmem_exit(0): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.207 PST [127701] DEBUG:  proc_exit(0): 0 callbacks to make
2024-11-27 06:01:14.207 PST [127701] DEBUG:  exit(0)
2024-11-27 06:01:14.207 PST [127701] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:01:14.208 PST [127701] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:01:14.208 PST [127701] DEBUG:  proc_exit(-1): 0 callbacks to make
  1. Fast Shutdown(默认方式)
    • 快速关闭模式,不再允许新的连接。
    • 向所有活跃的服务进程发送 SIGTERM 信号,让它们立即退出,然后等待所有子进程退出并关闭数据库
    • 如果服务处于在线备份状态,将直接终止备份,这将导致此次备份失败。
    • 使用 pg_ctl 命令的示例如下:
      pg_ctl stop -m fast
      

输出日志

2024-11-27 06:02:17.051 PST [127815] DEBUG:  postmaster received shutdown request signal
2024-11-27 06:02:17.051 PST [127815] LOG:  received fast shutdown request
2024-11-27 06:02:17.052 PST [127815] LOG:  aborting any active transactions
2024-11-27 06:02:17.052 PST [127815] DEBUG:  sending signal 15 to process 127823
2024-11-27 06:02:17.052 PST [127818] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  autovacuum launcher shutting down
2024-11-27 06:02:17.052 PST [127818] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127818] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:02:17.052 PST [127818] DEBUG:  exit(0)
2024-11-27 06:02:17.052 PST [127818] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127818] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127818] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  exit(0)
2024-11-27 06:02:17.052 PST [127821] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.052 PST [127821] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  logical replication launcher shutting down
2024-11-27 06:02:17.053 PST [127823] DEBUG:  shmem_exit(1): 5 before_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  shmem_exit(1): 6 on_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  proc_exit(1): 1 callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  exit(1)
2024-11-27 06:02:17.053 PST [127823] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127823] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.053 PST [127820] DEBUG:  shmem_exit(0): 4 before_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127815] DEBUG:  reaping dead processes
2024-11-27 06:02:17.053 PST [127820] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127820] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:02:17.053 PST [127820] DEBUG:  exit(0)
2024-11-27 06:02:17.053 PST [127820] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127820] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.053 PST [127820] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.053 PST [127815] DEBUG:  reaping dead processes
2024-11-27 06:02:17.053 PST [127815] LOG:  background worker "logical replication launcher" (PID 127823) exited with exit code 1
2024-11-27 06:02:17.053 PST [127815] DEBUG:  reaping dead processes
2024-11-27 06:02:17.053 PST [127817] LOG:  shutting down
2024-11-27 06:02:17.086 PST [127822] DEBUG:  executing archive command "test ! -f /home/pg16/archivelog/000000010000000400000030 && cp pg_wal/000000010000000400000030 /home/pg16/archivelog/000000010000000400000030"
2024-11-27 06:02:17.086 PST [127817] LOG:  checkpoint starting: shutdown immediate
2024-11-27 06:02:17.087 PST [127817] DEBUG:  performing replication slot checkpoint
2024-11-27 06:02:17.089 PST [127817] DEBUG:  checkpoint sync: number=1 file=pg_xact/0005 time=0.618 ms
2024-11-27 06:02:17.090 PST [127817] DEBUG:  checkpoint sync: number=2 file=pg_multixact/offsets/0000 time=0.175 ms
2024-11-27 06:02:17.090 PST [127817] DEBUG:  attempting to remove WAL segments older than log file 000000000000000400000030
2024-11-27 06:02:17.090 PST [127817] DEBUG:  removing write-ahead log file "00000001000000040000002F"
2024-11-27 06:02:17.093 PST [127817] DEBUG:  SlruScanDirectory invoking callback on pg_subtrans/005C
2024-11-27 06:02:17.093 PST [127817] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 1 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.008 s; sync files=2, longest=0.001 s, average=0.001 s; distance=16384 kB, estimate=16384 kB; lsn=4/31000028, redo lsn=4/31000028
2024-11-27 06:02:17.093 PST [127817] DEBUG:  shmem_exit(0): 5 before_shmem_exit callbacks to make
2024-11-27 06:02:17.093 PST [127817] DEBUG:  writing stats file "pg_stat/pgstat.stat"
2024-11-27 06:02:17.093 PST [127817] DEBUG:  shmem_exit(0): 5 on_shmem_exit callbacks to make
2024-11-27 06:02:17.093 PST [127817] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:02:17.093 PST [127817] DEBUG:  exit(0)
2024-11-27 06:02:17.094 PST [127817] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.094 PST [127817] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.094 PST [127817] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.095 PST [127815] DEBUG:  reaping dead processes
2024-11-27 06:02:17.102 PST [127822] DEBUG:  archived write-ahead log file "000000010000000400000030"
2024-11-27 06:02:17.102 PST [127822] DEBUG:  shmem_exit(0): 5 before_shmem_exit callbacks to make
2024-11-27 06:02:17.102 PST [127822] DEBUG:  archiver process shutting down
2024-11-27 06:02:17.102 PST [127822] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:02:17.102 PST [127822] DEBUG:  proc_exit(0): 1 callbacks to make
2024-11-27 06:02:17.102 PST [127822] DEBUG:  exit(0)
2024-11-27 06:02:17.102 PST [127822] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.102 PST [127822] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.102 PST [127822] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.102 PST [127815] DEBUG:  reaping dead processes
2024-11-27 06:02:17.102 PST [127815] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.103 PST [127815] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 06:02:17.105 PST [127815] DEBUG:  cleaning up orphaned dynamic shared memory with ID 2186499264
2024-11-27 06:02:17.106 PST [127815] DEBUG:  cleaning up dynamic shared memory control segment with ID 3559701182
2024-11-27 06:02:17.106 PST [127815] DEBUG:  proc_exit(0): 2 callbacks to make
2024-11-27 06:02:17.106 PST [127815] LOG:  database system is shut down
2024-11-27 06:02:17.106 PST [127815] DEBUG:  exit(0)
2024-11-27 06:02:17.106 PST [127815] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.106 PST [127815] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.106 PST [127815] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 06:02:17.106 PST [127816] DEBUG:  logger shutting down
2024-11-27 06:02:17.107 PST [127816] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.107 PST [127816] DEBUG:  shmem_exit(0): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.107 PST [127816] DEBUG:  proc_exit(0): 0 callbacks to make
2024-11-27 06:02:17.107 PST [127816] DEBUG:  exit(0)
2024-11-27 06:02:17.107 PST [127816] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 06:02:17.107 PST [127816] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 06:02:17.107 PST [127816] DEBUG:  proc_exit(-1): 0 callbacks to make
  1. Immediate Shutdown
    • 立即关闭模式,主进程 postgres 向所有子进程发送 SIGQUIT 信号,并且立即退出,所有的子进程也会立即退出。
    • 采用这种模式退出时,并不会妥善地关闭数据库系统,下次启动时数据库会重放 WAL 日志进行恢复,因此建议只在紧急的时候使用该方法。
    • 使用 pg_ctl 命令的示例如下:
      pg_ctl stop -m immediate
      

输出日志

2024-11-27 05:58:21.525 PST [127387] DEBUG:  postmaster received shutdown request signal
2024-11-27 05:58:21.525 PST [127387] LOG:  received immediate shutdown request
2024-11-27 05:58:21.526 PST [127387] DEBUG:  sending signal 3 to process 127395
2024-11-27 05:58:21.526 PST [127387] DEBUG:  reaping dead processes
2024-11-27 05:58:21.526 PST [127387] DEBUG:  reaping dead processes
2024-11-27 05:58:21.527 PST [127387] DEBUG:  reaping dead processes
2024-11-27 05:58:21.527 PST [127387] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 05:58:21.527 PST [127387] DEBUG:  shmem_exit(0): 6 on_shmem_exit callbacks to make
2024-11-27 05:58:21.531 PST [127387] DEBUG:  cleaning up orphaned dynamic shared memory with ID 2800411074
2024-11-27 05:58:21.531 PST [127387] DEBUG:  cleaning up dynamic shared memory control segment with ID 3983505204
2024-11-27 05:58:21.532 PST [127387] DEBUG:  proc_exit(0): 2 callbacks to make
2024-11-27 05:58:21.532 PST [127387] LOG:  database system is shut down
2024-11-27 05:58:21.532 PST [127387] DEBUG:  exit(0)
2024-11-27 05:58:21.532 PST [127387] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 05:58:21.532 PST [127387] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 05:58:21.532 PST [127387] DEBUG:  proc_exit(-1): 0 callbacks to make
2024-11-27 05:58:21.532 PST [127388] DEBUG:  logger shutting down
2024-11-27 05:58:21.532 PST [127388] DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
2024-11-27 05:58:21.532 PST [127388] DEBUG:  shmem_exit(0): 0 on_shmem_exit callbacks to make
2024-11-27 05:58:21.532 PST [127388] DEBUG:  proc_exit(0): 0 callbacks to make
2024-11-27 05:58:21.532 PST [127388] DEBUG:  exit(0)
2024-11-27 05:58:21.533 PST [127388] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2024-11-27 05:58:21.533 PST [127388] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2024-11-27 05:58:21.533 PST [127388] DEBUG:  proc_exit(-1): 0 callbacks to make

这些模式分别对应不同的信号:

  • SIGTERM 对应 Smart Shutdown
  • SIGINT 对应 Fast Shutdown
  • SIGQUIT 对应 Immediate Shutdown

通过这些不同的关机模式,可以根据具体需求选择合适的关机方式。


http://www.ppmy.cn/devtools/137748.html

相关文章

js实现高斯-约旦消元法求解Homography矩阵

最小二乘法来求解矩阵 // 计算Homography矩阵 function calculateHomography(srcPoints, dstPoints) {if (srcPoints.length ! dstPoints.length || srcPoints.length < 4) {throw new Error(需要至少四个点进行计算);}// 设置矩阵方程 Ax blet A [];let b [];// 构建方…

无人机+无人车+机器狗+自组网:城市一空地体化指挥系统技术详解

无人机、无人车、机器狗与自组网技术的结合&#xff0c;为城市空地一体化指挥系统带来了革命性的突破。以下是对这一技术的详细解析&#xff1a; 一、系统架构与关键技术 1. 系统架构 控制中心&#xff1a;负责整体任务的规划、调度与监控&#xff0c;通过远程指令控制各个无…

Llmcad: Fast and scalable on-device large language model inference

题目&#xff1a;Llmcad: Fast and scalable on-device large language model inference 发表于2023.09 链接&#xff1a;https://arxiv.org/pdf/2309.04255 声称是第一篇speculative decoding边缘设备的论文&#xff08;不一定是绝对的第一篇&#xff09;&#xff0c;不开源…

部署自动清理任务解决ORA-00257: archiver error. Connect internal only, until freed

使用oracle数据库的时候&#xff0c;我们一般都会开启归档&#xff0c;确保数据库的日志连续和和数据安全。但随着数据库的运行&#xff0c;归档文件会越来越多&#xff0c;最终撑满磁盘空间&#xff0c;数据库无法继续归档&#xff0c;出现“ORA-00257: archiver error. Conne…

Web day02 Js Vue Ajax

目录 1.javascript: 1.js的引入方式&#xff1a; 2.js变量 & 数据类型 & 输出语句&#xff1a; 模板字符串&#xff1a; 3.函数 & 自定义对象&#xff1a; 4. json 字符串 & DOM操作&#xff1a; 5. js事件监听&#xff1a; 6.js的模块化导入或者导出&a…

C++虚函数面试题及参考答案

目录 什么是虚函数?它的作用是什么? 如何在 C++ 中声明一个虚函数?请举个例子说明。 虚函数如何实现多态?请给出简单示例。 解释什么是动态绑定(dynamic binding)与静态绑定(static binding)。 如果基类的函数是虚函数,派生类的对应函数是否需要再次声明为虚函数…

深入理解Go语言中的`sync.Pool`与常规内存分配

在Go语言的并发编程中&#xff0c;内存管理是一个不可忽视的话题。sync.Pool作为Go标准库中的一个特殊工具&#xff0c;提供了一种对象池化机制&#xff0c;以优化内存分配和垃圾回收&#xff08;GC&#xff09;。本文将深入探讨sync.Pool与常规内存分配的主要区别&#xff0c;…

uni-app 自定义平台如何进行 static 目录的条件编译

一. 自定义平台如何进行 static 目录的条件编译 关于如何自定平台&#xff0c;参考之前文章&#xff1a; uni-app 玩转条件编译&#xff1a;自定义平台的条件编译实战详解https://blog.csdn.net/qq_24956515/article/details/143951206 由于官方不支持创建自定义平台下的 st…