Home Database Mysql Tutorial 性能问题解决案例01sybase数据库内存问题

性能问题解决案例01sybase数据库内存问题

Jun 07, 2016 pm 03:57 PM
sybase Memory performance database Case now solve question

最近现场反馈问题,所有电子签章页面打不开文书(pdf式),后台日志没报任何错误,效果就是空白: 1、首先想到是签章的ocx控件问题,检查ocx控件安装,发现其他电脑也打不开文书,测试页面可以直接打开pdf文档,排除控件的问题。 vcD4KPHA+CiAgICAyoaK7s9LJy

最近现场反馈问题,所有电子签章页面打不开文书(pdf格式),后台日志没报任何错误,效果就是空白:

\

1、首先想到是签章的ocx控件问题,检查ocx控件安装,发现其他电脑也打不开文书,测试页面可以直接打开pdf文档,排除控件的问题。喎?http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+CiAgICAyoaK7s9LJysfOxMrpz8LU2LP2zsrM4sHLo6y87LLpzsTK6c/C1Ni5psTco6zO0sPHysew0XBkZs7EyunPwtTYtb2xvrXYobDO0rXEzsS1taGxxL/CvNbQo6zIu7rzyrnTw29jeL/YvP608r+qzsTK6aOsvOyy6beiz9bT0LXEzsTK6cTc1f2zo8/C1Ni1vbG+tdijrNPQtcS4ybTgsrvPwtTYo6zE3M/C1Ni1vbG+tdi1xM7Eyum/ydLU1f2zo7Tyv6qho7zssulmdHC3os/WzsTK6ba8w7vOyszio6y2qM67zsrM4r7Ns/bU2rTTZnRwz8LU2NXiv+mhozwvcD4KPHA+CiAgICAzoaJmdHDPwtTY09Aysr2jrM/IyKXK/b7dv+LW0LLp0a+1vWNjYmijrNTZuPm+3WNjYmi002Z0cM/C1NijrLzssum3os/Wz8LU2MO7zsrM4qOssunRr2NjYmi3x7Ojwv2jrNfuv+zSstKqNTBzssXE3LLp0a+z9sC0o6zC/bXE0qo0oaI1t9bW06Os09DEzdDEtcS7sKOstci0/by4t9bW06OszsTK6crHv8nS1NW5yr6jrNLRvq22qM67tb3Oyszi1K3S8sHLo6yy6dGvY2NiaLXEc3Fs1rTQ0LfHs6PC/aGjPC9wPgo8cD4KICAgIDShorfWzvZzcWyjrLzyu6+683NxbM6qo7o8L3A+CjxwPgo8L3A+CjxwcmUgY2xhc3M9"brush:sql;">SELECT * FROM T_ZXLD_SYYH_FJ WHERE C_BH_SQ='76A1737D773BE344B7154AA479634FED' AND C_FJLX='syyhcx.zz.cxs.gy'

查询条件中C_BH_SQ是有索引的,理论上不应该这么慢呀,查看执行计划发现:

\

竟然没有用到索引,执行时间是274s。有索引却没用到,而且C_BH_SQ这个字段是主表主键,被选中概率应该非常高,怀疑是统计信息出问题了,使用

UPDATE all STATISTICS T_ZXLD_SYYH_FJ
Copy after login

更新统计信息,更新后执行原始sql,用了0.12s,执行计划也显示出使用了索引

\

问题看似解决了,但是偶尔还会出现打开非常慢(快的10s左右,慢的几分钟)的情况,怎么回事呢?检查过程中发现不仅仅这个页面偶尔慢,很多页面都偶尔非常慢,第一次打开慢,后续就很快了,等一会再打开又慢了。

查看p6spy日志发现(深颜色列是sql执行时间,只记录了执行2s以上的sql),把执行时间长的sql拿出来单独执行,很多第一次执行几十秒,第二次执行不到1s,可以确定问题原因了,系统内存较小。

\

sybase数据可以使用下面命令查看io情况:SET STATISTICS io ON"OFF

\

第一次执行结果:

\

第二次执行结果:

可以看到第一次从磁盘和内存都读取了内容,第二次physical reads是0,完全从内存读取当然查询快了,内存较小的话,其他查询数据读进内存后,把旧的数据从内存中清除,再查询旧数据还需要从磁盘读取到内存,所以经常出现第一次较慢,后续较快情况。最好办法就是加大内存,把常用的数据都读取到内存中缓存起来。

解决办法建议现场升级sybase到15.7,因为sybase12.5.3没有64位版本,32位最多使用内存2G,好多表都是上百万的数据,确实查询较慢。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Large memory optimization, what should I do if the computer upgrades to 16g/32g memory speed and there is no change? Large memory optimization, what should I do if the computer upgrades to 16g/32g memory speed and there is no change? Jun 18, 2024 pm 06:51 PM

Large memory optimization, what should I do if the computer upgrades to 16g/32g memory speed and there is no change?

Sources say Samsung Electronics and SK Hynix will commercialize stacked mobile memory after 2026 Sources say Samsung Electronics and SK Hynix will commercialize stacked mobile memory after 2026 Sep 03, 2024 pm 02:15 PM

Sources say Samsung Electronics and SK Hynix will commercialize stacked mobile memory after 2026

Kingbang launches new DDR5 8600 memory, offering CAMM2, LPCAMM2 and regular models to choose from Kingbang launches new DDR5 8600 memory, offering CAMM2, LPCAMM2 and regular models to choose from Jun 08, 2024 pm 01:35 PM

Kingbang launches new DDR5 8600 memory, offering CAMM2, LPCAMM2 and regular models to choose from

Longsys displays FORESEE LPCAMM2 notebook memory: up to 64GB, 7500MT/s Longsys displays FORESEE LPCAMM2 notebook memory: up to 64GB, 7500MT/s Jun 05, 2024 pm 02:22 PM

Longsys displays FORESEE LPCAMM2 notebook memory: up to 64GB, 7500MT/s

DDR5 MRDIMM and LPDDR6 CAMM memory specifications are ready for launch, JEDEC releases key technical details DDR5 MRDIMM and LPDDR6 CAMM memory specifications are ready for launch, JEDEC releases key technical details Jul 23, 2024 pm 02:25 PM

DDR5 MRDIMM and LPDDR6 CAMM memory specifications are ready for launch, JEDEC releases key technical details

Performance comparison of different Java frameworks Performance comparison of different Java frameworks Jun 05, 2024 pm 07:14 PM

Performance comparison of different Java frameworks

Lexar God of War Wings ARES RGB DDR5 8000 Memory Picture Gallery: Colorful White Wings supports RGB Lexar God of War Wings ARES RGB DDR5 8000 Memory Picture Gallery: Colorful White Wings supports RGB Jun 25, 2024 pm 01:51 PM

Lexar God of War Wings ARES RGB DDR5 8000 Memory Picture Gallery: Colorful White Wings supports RGB

It is reported that Samsung Electronics has confirmed investment in the 1cnm DRAM memory production line of Pyeongtaek P4 factory and aims to put it into operation in June next year. It is reported that Samsung Electronics has confirmed investment in the 1cnm DRAM memory production line of Pyeongtaek P4 factory and aims to put it into operation in June next year. Aug 12, 2024 pm 04:31 PM

It is reported that Samsung Electronics has confirmed investment in the 1cnm DRAM memory production line of Pyeongtaek P4 factory and aims to put it into operation in June next year.

See all articles