AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题

问题[ssd](dba)

Martin Hope
guettli
Asked: 2018-04-18 04:25:18 +0800 CST

自动检测“random_page_cost”与“seq_page_cost”

  • 11

我读了这篇关于 PostgreSQL 在 SSD 上的性能的文章:

https://amplitude.engineering/how-a-single-postgresql-config-change-improved-slow-query-performance-by-50x-85593b8991b0

这两种配置似乎很重要random_page_costvsseq_page_cost

由于两个参数都需要匹配特定的硬件,我想知道是否可以自动检测匹配值?

更新

我有这些步骤:

  1. 脚本创建一些虚拟表
  2. 脚本将数据插入到表中
  3. 脚本执行一些查询
  4. 脚本显示 random_page_cost 和 seq_page_cost 的匹配值
  5. 人工或自动化系统获取这些值并更新配置。这一步不是问题的一部分。
postgresql ssd
  • 1 个回答
  • 11044 Views
Martin Hope
seamus
Asked: 2015-12-16 03:17:30 +0800 CST

联机时将 SQL Server 数据库移动到新磁盘

  • 12

我有一个 1.4TB 的 SQL Server 数据库,它在磁盘 I/O 方面遇到了巨大的困难。我们已经在服务器中安装了一个新的 SSD 阵列,它将解决我们所有的问题,我们只是在讨论移动数据库的最佳方式。理想情况下,如果我们可以在不停机的情况下做到这一点,那是最好的。但是,如果要在两天的性能不佳(例如,在复制数据时)与两小时的停机时间之间进行选择,则后者可能更可取。

到目前为止,我们提出的解决方案是:

  • 简单的复制。使数据库脱机,复制文件,更改 SQL Server 中的位置并将其重新联机。粗略的数字估计这将需要长达五个小时,这不是真正可以接受的,但它是最简单的解决方案。

  • 块级副本。使用类似 rsync 的实用程序,我们在数据库启动时在后台复制文件。当我们准备好迁移时,我们将数据库脱机,使用此实用程序进行差异复制,然后将 SQL Server 指向新文件并使其联机。这里的时间是未知的。我们不知道对 1.4TB 进行差异分析并将其复制过来需要多长时间。我们的另一个顾虑是块级副本会使文件处于 SQL Server 无法读取的某些状态,这会浪费我们的时间。

  • SQL 迁移。在新磁盘上创建一个新的 1.4TB SQL 数据文件并禁用所有其他文件的自动增长。然后依次对所有其他数据文件运行 DBBC SHRINKFILE(-file_name-, EMPTYFILE)。一旦所有数据都传输完毕,我将在某个时间安排一个预定窗口将 MDF 文件移动到 SSD 并删除其他未使用的文件。我喜欢这个,因为它可以最大限度地减少停机时间。但我不知道这需要多长时间,以及它是否会导致性能下降。

我们没有任何类型的负载和性能环境来测试它。我可以验证这些策略是否适用于我们的暂存环境,但不是影响,也不是性能。

sql-server ssd
  • 2 个回答
  • 2288 Views
Martin Hope
dkitchel
Asked: 2015-08-14 18:00:36 +0800 CST

当托管表空间的 RAID 驱动器超时时,如何让 postgres 在它挂起后恢复进程

  • 1

几乎每天一次,我会在控制台中出现超时,例如:

7:1:36 PM kernel: Areca RAID volume scsi command timeout (target=0 lun=0)

这恰好对应于所有 postgres 进程挂起的时间。

我不愿意终止 pids,因为这往往会导致一切崩溃。无论如何要复活这些过程?我什至无法在终端中打开一个新的 postgres 窗口。

另外,有没有办法让 postgres 更能容忍这种超时?我的系统:

  • Mac Pro (2013) 12 核 X 64GB
  • 操作系统 10.10.4
  • Postgres 9.4.4

我用于表空间的驱动器(其中 4 个)是:

  • 槟榔 8050 T2
  • 每个都有 8 个 1TB OWC Mercury Electra 6G SSD,采用 RAID 0 配置。
postgresql ssd
  • 1 个回答
  • 149 Views
Martin Hope
Ben The Novice
Asked: 2014-10-03 12:30:43 +0800 CST

使用 SSD 上的 mySQL 升级到新的 cPanel 服务器——我应该在 my.cnf 中更改什么?

  • 2

我正在使用 whm/cpanel 升级到更快的服务器,mysql 数据库将位于 SSD 上。我读过一些关于不需要任何查询缓存和类似内容的文章,但作为新手,我了解到修改 my.cnf 可能是灾难性的。

这是我基于“硬盘”的网络服务器的当前 my.cnf。

[mysqld]
query_cache_limit=32M
query_cache_size=128M
query_cache_type=1
query_cache_min_res_unit=4096
open_files_limit=16000

table_open_cache=25000
table_definition_cache=2000
key_buffer_size=128M
innodb_buffer_pool_size=2000M
innodb_buffer_pool_instances=2
join_buffer_size=4M
sort_buffer_size=4M
read_rnd_buffer_size=4M
tmp_table_size=3048M
max_heap_table_size=3048M
thread_cache_size=256

max_connections=250
table_cache=60000

如果 mysql 在 SSD 上,您会对其进行哪些更改?

以下是来自 tuner.sh 的一些信息:

Avg. qps = 447

WORKER THREADS
Current thread_cache_size = 256
Current threads_cached = 96
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 250
Current threads_connected = 20
Historic max_used_connections = 116
The number of used connections is 46% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 794 M
Current InnoDB data space = 1.10 G
Current InnoDB buffer pool free = 14 %
Current innodb_buffer_pool_size = 1.95 G
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 3.62 G
Configured Max Per-thread Buffers : 3.02 G
Configured Max Global Buffers : 2.21 G
Configured Max Memory Limit : 5.23 G
Physical Memory : 15.56 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 222 M
Current key_buffer_size = 128 M
Key cache miss rate is 1 : 1115
Key buffer free ratio = 72 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 128 M
Current query_cache_used = 28 M
Current query_cache_limit = 32 M
Current Query cache Memory fill ratio = 22.42 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 4 M
Current read_rnd_buffer_size = 4 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 4.00 M
You have had 166 queries where a join could not use an index properly
join_buffer_size >= 4 M
This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.

OPEN FILES LIMIT
Current open_files_limit = 120260 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_open_cache = 60000 tables
Current table_definition_cache = 2000 tables
You have a total of 733 tables
You have 851 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 2.97 G
Current tmp_table_size = 2.97 G
Of 262494 temp tables, 33% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your 
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 1005 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 101097
Your table locking seems to be fine

OLD 网络服务器是一个 8 核单 Xeon @ 16GB 内存。新的网络服务器是一个 24 核双至强@64GB 内存。新服务器上的 SSD 将仅包含操作系统和数据库,所有站点均基于 WordPress,因此每天的总浏览量约为 250,000 次。

非常感谢您的帮助或建议!

问候,

本

mysql ssd
  • 1 个回答
  • 988 Views
Martin Hope
Hammie4
Asked: 2014-03-05 11:02:05 +0800 CST

SQL Server Express 2008:我可以将数据库文件(.mdf、.ldf)存储在默认 DATA 目录以外的目录中吗?

  • 1

我有一个 SQL Server Express 2008 实例,我经常从开发系统中附加数据库。通常我将.MDF和.LDF文件传输到实例的DATA文件夹并重新附加,一切都很好。过去,当我们使用 Access 而不是 SQL Server Express 时,我会将数据库文件保存在单独的驱动器 (SSD) 上,这往往会提高性能,同时让我在整个 SSD 上使用 BitLocker 驱动器加密,以便于加密和整体驱动器备份。我想对 SQL Server Express 做同样的事情。

我可以将.mdfand.ldf文件放在单独的驱动器上(而不是在实例DATA文件夹中)而不会产生任何不良影响吗?我是否需要通过 Management Studio 更改设置才能执行此操作?我还能使用 BitLocker 加密吗?

非常感谢!

sql-server-express ssd
  • 1 个回答
  • 1882 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve