zoukankan      html  css  js  c++  java
  • PostgreSQL 非持久化设置(Non-Durable Settings)

    Durability is a database feature that guarantees the recording of committed transactions even if the server crashes or loses power. However, durability adds significant database overhead, so if your site does not require such a guarantee, PostgreSQL can be configured to run much faster. The following are configuration changes you can make to improve performance in such cases. Except as noted below,durability is still guaranteed in case of a crash of the database software; only abrupt operating system stoppage creates a risk of data loss or corruption when these settings are used.

    • Place the database cluster’s data directory in a memory-backed file system (i.e. RAM disk). This

    eliminates all database disk I/O, but limits data storage to the amount of available memory (and perhaps swap).

    • Turn off fsync; there is no need to flush data to disk.

    • Turn off synchronous_commit; there might be no need to force WAL writes to disk on every commit.

    This setting does risk transaction loss (though not data corruption) in case of a crash of the

    database.

    • Turn off full_page_writes; there is no need to guard against partial page writes.

    • Increase checkpoint_segments and checkpoint_timeout ; this reduces the frequency of checkpoints,

    but increases the storage requirements of /pg_xlog.

    • Create unlogged tables to avoid WAL writes, though it makes the tables non-crash-safe.

    [root@DELL-R720 data]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

    2

    [root@DELL-R720 data]# cat /proc/cpuinfo| grep "cpu cores"| uniq

    cpu cores : 6

    [root@DELL-R720 data]# cat /proc/cpuinfo| grep "processor"| wc -l

    24

    [root@DELL-R720 data]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

         24  Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz

  • 相关阅读:
    基于python内置方法进行代码混淆
    python-__getattr__ 和 __getattribute__
    python-flask学习
    python-创建进程的三种方式
    python-property、__get__、__set__
    call apply bind
    【算法】js实现最短时间走完不同速度的路程
    图片懒加载实现
    MoonLight可视化订单需求区域分析系统前端
    前端代码基本命名规范和格式规范
  • 原文地址:https://www.cnblogs.com/songyuejie/p/5029585.html
Copyright © 2011-2022 走看看