久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區

標題: 升級腳本優化 [打印本頁]

作者: VRobin    時間: 2023-1-13 09:11
標題: 升級腳本優化
腳本在修復序列化數據的時候對空值沒有處理, 會執行大量無用sql


  1. UPDATE `pre_common_member_field_forum` SET `groups` = '' WHERE `uid` = '71800'
復制代碼


501行修改成
  1. $sql = "SELECT `$sfield`, `$sid` FROM `$stable` WHERE `$sfield`<>'' AND `$sid` > $start ORDER BY `$sid` ASC LIMIT $limit";
復制代碼
忽略空值, 可以優化升級速度

作者: 老周部落    時間: 2023-1-13 21:18
感謝您的建議,我們正在優化升級程序,后續版本測試無誤將添加此優化。
作者: Leo    時間: 2023-1-13 21:33
老周部落 發表于 2023-1-13 21:18
感謝您的建議,我們正在優化升級程序,后續版本測試無誤將添加此優化。

什么時候出新版升級文件啊
作者: 老周部落    時間: 2023-1-13 21:40
Leo 發表于 2023-1-13 21:33
什么時候出新版升級文件啊

還得等等,我這邊在統計常見問題,完了寫代碼規避。
幾天時間應該是可以的。
作者: Leo    時間: 2023-1-15 13:16
老周部落 發表于 2023-1-13 21:40
還得等等,我這邊在統計常見問題,完了寫代碼規避。
幾天時間應該是可以的。 ...

升級文件還涉不涉及到數據庫結構 字段 的改動啊
作者: 老周部落    時間: 2023-1-15 13:56
Leo 發表于 2023-1-15 13:16
升級文件還涉不涉及到數據庫結構 字段 的改動啊

X3.5 正式版肯定不涉及的,只是效率優化以及對常見錯誤的規避。
另外之前有個關于地區的反饋,可能涉及到數據庫指令,這個到時候單獨通知。
作者: shw1395    時間: 2023-1-15 18:36
老周部落 發表于 2023-1-15 13:56
X3.5 正式版肯定不涉及的,只是效率優化以及對常見錯誤的規避。
另外之前有個關于地區的反饋,可能涉及到 ...
  1. InnoDB: page_cleaner: 1000ms intended loop took 5586ms. The settings might not be optimal. (flushed=128 and evicted=336, during the time.)For more information, see Help and Support Center at http://www.mysql.com.  
復制代碼
  1. 2023-01-15T10:17:36.266581Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 6253ms. The settings might not be optimal. (flushed=374 and evicted=154, during the time.)
  2. 2023-01-15T10:18:51.681066Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 9594ms. The settings might not be optimal. (flushed=535 and evicted=215, during the time.)
  3. 2023-01-15T10:21:40.868902Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 8006ms. The settings might not be optimal. (flushed=555 and evicted=136, during the time.)
復制代碼

卡在pre_forum_post這張表上了,message大概2G左右,http://127.0.0.1/install/update_adult.php?step=innodb&table=pre_forum_post&scheme=1,已經無法下一步,MySQL改了innodb_lru_scan_depth, innodb_io_capacity, innodb_buffer_pool_instances,等參數,瀏覽器超時,大概一個小時不到會提示一次超時,服務器是雙核8G內存的比較渣。
作者: 老周部落    時間: 2023-1-16 07:50
shw1395 發表于 2023-1-15 18:36
卡在pre_forum_post這張表上了,message大概2G左右,http://127.0.0.1/install/update_adult.php?step= ...

1. 可以升級到 MySQL 5.7 以上,InnoDB 性能會有改善,有概率能正常跑過去。
2. 可以手動在升級程序找到  ALTER TABLE 語句去命令行跑 InnoDB 升級,跑完之后找到下一個表繼續讓升級程序跑。
作者: shw1395    時間: 2023-1-16 12:18
老周部落 發表于 2023-1-16 07:50
1. 可以升級到 MySQL 5.7 以上,InnoDB 性能會有改善,有概率能正常跑過去。
2. 可以手動在升級程序找到  ...
  1. mysql> status
  2. --------------
  3. mysql  Ver 14.14 Distrib 5.7.39, for Win64 (x86_64)

  4. Connection id:          3752
  5. Current database:
  6. Current user:           root@localhost
  7. SSL:                    Cipher in use is ECDHE-RSA-AES128-GCM-SHA256
  8. Using delimiter:        ;
  9. Server version:         5.7.39 MySQL Community Server (GPL)
  10. Protocol version:       10
  11. Connection:             localhost via TCP/IP
  12. Server characterset:    latin1
  13. Db     characterset:    latin1
  14. Client characterset:    gbk
  15. Conn.  characterset:    gbk
  16. TCP port:               3306
  17. Uptime:                 10 hours 46 min 54 sec

  18. Threads: 1  Questions: 53331  Slow queries: 0  Opens: 8946  Flush tables: 1  Open tables: 1801  Queries per second avg: 1.374
復制代碼
  1. php-8.2.1 / Xeon E5-2696 2.5G / Red Hat VirtIO SCSI Disk / Server 2019 Datacenter 1809 17763.1
復制代碼

感謝你的回復信息,超時太嚴重了,已經放棄。page_cleaner 搜了一天,似乎沒啥好的解決辦法,不是 DBA,一天時間都解決不了問題,決定止損。




歡迎光臨 Discuz! 官方交流社區 (http://www.9999xn.com/) Powered by Discuz! W1.0