暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GaussDB T : 100 的多线程模式及后台线程介绍

原创 eygle 2019-12-06
839

在 GaussDB 启动的过程中,可以从日志中清晰的看到,后台依次启动了一系列的线程。


GaussDB 100采用单进程、多线程结构。服务器在运行时由各种内存数据结构和一系列线程组成,不同类型的线程完成不同的任务,这其中包括 LGWR / DBWR / CKPT / SMON / STATS ,基本上与 Oracle 命名保持一致。



UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|77309420628|INFO>[LOG] file '/ssd_data/gaussdb/gaussdata/log/enmotech_alarm.log' is added [srv_param.c:488]


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[LOG] file '/ssd_data/gaussdb/gaussdata/log/run/zengine.rlog' is added [cm_log.c:643]


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] LSNR_ADDR = 127.0.0.1


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] LSNR_PORT = 1611


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] DATA_BUFFER_SIZE = 2G


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] SHARED_POOL_SIZE = 1G


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] LOG_BUFFER_SIZE = 64M


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] LOG_BUFFER_COUNT = 8


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] TEMP_BUFFER_SIZE = 1G


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] SESSIONS = 1500


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] CONTROL_FILES = (/gaussdb/gaussdata/data/cntl1, /gaussdb/gaussdata/data/cntl2, /gaussdb/gaussdata/data/cntl3)


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] DBWR_PROCESSES = 8


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] INSTANCE_NAME = enmotech


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|9300|INFO>[PARAM] ENABLE_SYSDBA_LOGIN = TRUE


UTC+8 2019-12-06 17:05:28.691|ZENGINE|00000|206158439508|INFO>starting instance(normal)


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9302|INFO>lgwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9303|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9305|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9306|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9304|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9307|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9308|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9309|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9310|INFO>dbwr thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9311|INFO>ckpt thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9312|INFO>smon thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9313|INFO>stats thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9314|INFO>index page recycle thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9315|INFO>rollback thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9316|INFO>rollback thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9317|INFO>rmon thread started


UTC+8 2019-12-06 17:05:28.743|ZENGINE|00000|9318|INFO>job master thread started


UTC+8 2019-12-06 17:05:28.782|ZENGINE|00000|9319|INFO>reactor thread started


UTC+8 2019-12-06 17:05:28.782|ZENGINE|00000|9300|INFO>local ip: 127.0.0.1


UTC+8 2019-12-06 17:05:28.782|ZENGINE|00000|9320|INFO>tcp-lsnr thread started


UTC+8 2019-12-06 17:05:28.782|ZENGINE|00000|9321|INFO>uds-lsnr thread started


UTC+8 2019-12-06 17:05:28.788|ZENGINE|00000|9300|INFO>SSL disabled: server certificate or private key file is not available.


UTC+8 2019-12-06 17:05:28.788|ZENGINE|00000|9300|INFO>start to alter database MOUNT


UTC+8 2019-12-06 17:05:28.823|ZENGINE|00000|9300|INFO>[ARCH] Init arch is_archive 0


UTC+8 2019-12-06 17:05:28.823|ZENGINE|00000|9300|INFO>[ARCH] Initialization complete


UTC+8 2019-12-06 17:05:28.823|ZENGINE|00000|9300|INFO>sucessfully alter database MOUNT


UTC+8 2019-12-06 17:05:28.823|ZENGINE|00000|206158439508|INFO>start to alter database OPEN


UTC+8 2019-12-06 17:05:28.841|ZENGINE|00000|140733193397332|INFO>[ARCH] Start ARCH thread for ARCHIVE_DEST_1[/ssd_data/gaussdb/gaussdata/archive_log]


UTC+8 2019-12-06 17:05:28.841|ZENGINE|00000|6477904490279216212|INFO>The last shutdown is a consistent shutdown


UTC+8 2019-12-06 17:05:28.841|ZENGINE|00000|9300|INFO>database start recovery


UTC+8 2019-12-06 17:05:28.841|ZENGINE|00000|9300|INFO>recovery from file:1,point:83006,lfn:15709


UTC+8 2019-12-06 17:05:28.841|ZENGINE|00000|9300|INFO>recovery expected least end with file:1,point:83006,lfn:15709


UTC+8 2019-12-06 17:05:28.860|ZENGINE|00000|140733193397332|INFO>[RCY] recovery real end with file:1,point:83006,lfn:15709


UTC+8 2019-12-06 17:05:28.860|ZENGINE|00000|140733193397332|INFO>[RCY] current lfn 15709, rcy point lfn 15709, consistent point 15709, lrp point lfn 15709


UTC+8 2019-12-06 17:05:28.889|ZENGINE|00000|140642999084116|INFO>no valid standby configuration


UTC+8 2019-12-06 17:05:28.889|ZENGINE|00000|9300|INFO>[DB] sse42 available 1


UTC+8 2019-12-06 17:05:28.889|ZENGINE|00000|9300|INFO>sucessfully alter database OPEN


UTC+8 2019-12-06 17:05:28.889|ZENGINE|00000|9300|INFO>instance started


UTC+8 2019-12-06 17:05:28.942|ZENGINE|00000|9315|INFO>rollback thread closed [knl_tran.c:1306]


UTC+8 2019-12-06 17:05:28.942|ZENGINE|00000|9316|INFO>rollback thread closed [knl_tran.c:1306]


UTC+8 2019-12-06 17:05:29.751|ZENGINE|00053|9327|INFO>load table parts: load table parts, uid: 0, tid: 289, partcnt: 3962 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.751|ZENGINE|00053|13850784198304879|INFO>load index parts: load index parts, uid: 0, tid: 289, iid: 0, index partcnt: 3962 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.768|ZENGINE|00053|9327|INFO>load table parts: load table parts, uid: 0, tid: 275, partcnt: 35 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.782|ZENGINE|00053|9327|INFO>load table parts: load table parts, uid: 0, tid: 285, partcnt: 35 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.787|ZENGINE|00053|14135557709898863|INFO>load index parts: load index parts, uid: 0, tid: 285, iid: 0, index partcnt: 35 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.791|ZENGINE|00054|9328|INFO>load table parts: load table parts, uid: 0, tid: 266, partcnt: 3962 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.791|ZENGINE|00054|13855182244815984|INFO>load index parts: load index parts, uid: 0, tid: 266, iid: 0, index partcnt: 3962 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.791|ZENGINE|00054|9328|INFO>load table parts: load table parts, uid: 0, tid: 263, partcnt: 3962 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.791|ZENGINE|00054|9328|INFO>load table parts: load table parts, uid: 0, tid: 264, partcnt: 3962 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.791|ZENGINE|00054|13855182244815984|INFO>load index parts: load index parts, uid: 0, tid: 264, iid: 0, index partcnt: 3962 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.793|ZENGINE|00054|9328|INFO>load table parts: load table parts, uid: 0, tid: 265, partcnt: 3962 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.793|ZENGINE|00054|14418132198237296|INFO>load index parts: load index parts, uid: 0, tid: 265, iid: 0, index partcnt: 3962 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.795|ZENGINE|00053|140642999084143|INFO>load table parts: load table parts, uid: 0, tid: 287, partcnt: 35 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.799|ZENGINE|00053|9327|INFO>load table parts: load table parts, uid: 0, tid: 291, partcnt: 1 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.799|ZENGINE|00053|16106982058501231|INFO>load index parts: load index parts, uid: 0, tid: 291, iid: 0, index partcnt: 1 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.801|ZENGINE|00053|46913927783535|INFO>load table parts: load table parts, uid: 0, tid: 290, partcnt: 1 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.801|ZENGINE|00053|13845290935133295|INFO>load index parts: load index parts, uid: 0, tid: 290, iid: 0, index partcnt: 1 [knl_partition.c:2358]


UTC+8 2019-12-06 17:05:29.805|ZENGINE|00053|9327|INFO>load table parts: load table parts, uid: 0, tid: 293, partcnt: 35 [knl_partition.c:1493]


UTC+8 2019-12-06 17:05:29.811|ZENGINE|00053|14971190841975919|INFO>load index parts: load index parts, uid: 0, tid: 293, iid: 0, index partcnt: 35 [knl_partition.c:2358]



操作系统的进程则仅有核心一个:



[root@enmodb3 run]# ps -ef|grep eygle


root 5453 5400 0 10:30 pts/0 00:00:00 su - eygle


eygle 5454 5453 0 10:30 pts/0 00:00:00 -bash


eygle 9300 1 0 17:05 pts/0 00:00:08 /ssd_data/gaussdb/1.0.0/bin/zengine open -D /ssd_data/gaussdb/gaussdata


官方文档说明如下:




GaussDB 100为保证SYS用户在紧急情况下可以操作数据库,为SYS用户预留5个独立会话、1个工作线程。


日常运行中有16个默认的自治事务会话(可以通过AUTONOMOUS_SESSIONS、KNL_AUTONOMOUS_SESSIONS参数设置),32个预留的内部使用会话,用于资源回收、checkpoint等,16个sql并行框架会话。内部使用会话功能如下表所示。










































































































































SID



session功能



0



切换实例状态,例如kernel启停,主机降备,备机升主等



1



lgwr线程



2



ckpt线程



3



smon线程



4



预留,暂未使用



5



undo preload线程



6



arch线程



7



rst线程



8



lsnr线程



9



mrp线程



10



预留,暂未使用



11



fal线程



12



timer线程



13



rollback线程



14



预留,暂未使用



15



log async线程



16



gts synchronizer线程



17



rcy线程



18



预留,暂未使用



19



预留,暂未使用



20



预留,暂未使用



21



预留,暂未使用



22



预留,暂未使用



23



预留,暂未使用



24



预留,暂未使用



25



shd trans clean线程



26



stats线程



27



插入统计信息到临时表,加载临时表的统计信息到dc上



28



加载分布式的节点



29



job线程



30



index page recycle线程



31



预留,暂未使用






这是非常早期的信息,会随着版本变化而变化。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论