【问题标题】:Postgresql causing "no space on device" error but disks/partitions are not fullPostgresql 导致“设备上没有空间”错误,但磁盘/分区未满
【发布时间】:2009-09-03 21:34:16
【问题描述】:

我在运行我的 Rails 网站时遇到以下错误,我相信它会导致它出现故障。我正在使用Passenger,我的网站流量很大。当我尝试让它重新上线时,Apache 产生了大量的子节点,机器上的负载飙升到 50 左右,网站变得非常缓慢。我不缺磁盘。

PGError (FATAL:  could not access status of transaction 0
DETAIL:  could not write to file "pg_subtrans/009B" at offset 8192: No space left on device):
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:876:in `initialize'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:876:in `connect'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:876:in `connect'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:276:in `initialize'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `send'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `connection='
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in `retrieve_connection'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
    /vendor/rails/activerecord/lib/active_record/query_ca

【问题讨论】:

    标签: ruby-on-rails postgresql passenger


    【解决方案1】:

    “设备上没有剩余空间”错误不一定是由空间不足引起的。它也可能是由文件系统的 inode 表填满引起的 - 换句话说,您的文件系统只能容纳这么多文件,而您已经达到了这个限制。

    如果您有大量的小文件,就会发生这种情况。在这些情况下,通常会使用大型 inode 表构建新的文件系统,以允许更多的小文件。

    【讨论】:

    • 要检查这一点,请从 shell 运行 df -i
    【解决方案2】:

    另一种可能性是每个用户的磁盘配额 - 请参阅 http://www.postgresql.org/docs/8.4/static/disk-full.html

    【讨论】:

      猜你喜欢
      • 2017-03-31
      • 1970-01-01
      • 1970-01-01
      • 2012-11-15
      • 2010-11-06
      • 1970-01-01
      • 2022-10-18
      • 2018-11-22
      • 1970-01-01
      相关资源
      最近更新 更多