Available PostgreSQL database disk space dropping abruptly
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
A sudden spike in Confluence database server's disk utilization, dropping the total available storage, can lead to the disk space running out of space and to an outage. Simultaneously, multiple temp files are created within the server, which contributes to the decrease in available storage.
環境
- Confluence On-Prem 7.19.0
- PostgreSQL 11
診断
- Rapid usage of disk usage by the database;
- Multiple temporary files are being created by the database;
- The following entry can be seen in the atlassian-confluence.log files:
2023-03-20 19:21:01,271 ERROR [http-nio-8080-exec-46 url: /display/XXXXX/XXXXX, /pages/viewpage.action; user: admin] [engine.jdbc.spi.SqlExceptionHelper] logExceptions ERROR: could not write to file "base/pgsql_tmp/pgsql_tmp15718.0.sharedfileset/i654of131174.p0.0": No space left on device
原因
In a PostgreSQL database, there is a setting called work_mem. This setting specifies the amount of memory used by internal sort operations and hash tables before writing to temporary disk files.
By default, the work_mem setting is 4 MB; however, for complex queries, 4 MB is not enough memory. As a result, the database will write data into temporary files and, depending on the operation, can lead to multiple temporary files being created. Those many temp files may be a sign that the database work_mem
parameter may be insufficient to handle the requests in the environment, as having a small enough work_mem can cause operations to spill over from work_mem (memory) to disk (which in turn can lead to disk overuse), affecting the performance of the application.
ソリューション
To prevent the creation of multiple temporary files on disk and, therefore, to improve the performance and free disk storage, the work_mem value can be increased on the database directly: