ฉันมีปัญหาดังต่อไปนี้: การแจกจ่าย Linux "แนวตั้ง" (Sophos UMT) มาพร้อมกับ PostgreSQL 9.2 เพื่อจัดเก็บการกำหนดค่า น่าเสียดายเนื่องจากการอัปเดตครั้งล่าสุดดูเหมือนว่าทรานแซกชันบันทึก (WAL) ของบางอินสแตนซ์จะเพิ่มขึ้นโดยไม่ต้องล้างออก สิ่งนี้ทำให้โฟลเดอร์ pg_xlog โตขึ้นเป็นลำดับขนาดใหญ่กว่าโฟลเดอร์ฐาน
ตอนนี้ฉันอยู่ในสถานการณ์ที่ละเอียดอ่อน: เนื่องจากการเติบโตของไฟล์ WAL ที่มากเกินไปดิสก์ของหนึ่งในเครื่องเหล่านี้ (VM) จะเต็มก่อนวันจันทร์ ฉันได้เปิดเคสการสนับสนุนกับผู้จำหน่ายแล้ว แต่จนถึงตอนนี้พวกเขาไม่ได้มีประโยชน์มาก (พวกเขาแนะนำให้เราสร้าง VM ใหม่ด้วยดิสก์ขนาดใหญ่)
ฐานข้อมูลนี้ไม่ถูกสำรองเนื่องจากซอฟต์แวร์ทำการสำรองข้อมูลในลักษณะที่แตกต่างกัน (มีขั้นตอนการสำรองข้อมูลของตัวเองและส่งไฟล์สำรองทางอีเมล) และฉันคิดว่านี่เป็นสาเหตุที่ WAF เติบโตขึ้นอย่างมาก
ฉันกลัวว่าฉันไม่ได้เป็นผู้เชี่ยวชาญของ PostgreSQL ดังนั้นจึงเป็นไปได้มากที่ฉันจะถามคำถามที่งี่เง่าหรือชัดเจน แต่ขั้นตอนในการร้องขอไฟล์ WAL จะถูกล้างออกเป็นอย่างไร
เป็นการดีที่ฉันกำลังมองหาขั้นตอนที่จะทำให้ฉันสามารถล้างไฟล์ WAL เหล่านี้ในระบบที่มีปัญหาเพื่อซื้อเวลาให้เพียงพอเพื่อให้ผู้ขายออกการแก้ไขที่ดีกว่า
แก้ไข : ตามที่ร้องขอนี่คือผลลัพธ์ของSELECT version();
แบบสอบถาม:
PostgreSQL 9.2.4 on i686-pc-linux-gnu, compiled by gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973], 32-bit
(1 แถว)
และSELECT name, current_setting(name), source
FROM pg_settings
WHERE source NOT IN ('default', 'override');
แบบสอบถาม
hot_standby | on | configuration file
listen_addresses | * | configuration file
log_destination | syslog | configuration file
log_min_duration_statement | -1 | configuration file
log_min_error_statement | error | configuration file
log_min_messages | notice | configuration file
maintenance_work_mem | 512MB | configuration file
max_connections | 300 | configuration file
max_files_per_process | 1000 | configuration file
max_prepared_transactions | 0 | configuration file
max_stack_depth | 2MB | configuration file
max_standby_streaming_delay | 10s | configuration file
max_wal_senders | 10 | configuration file
password_encryption | on | configuration file
pg_stat_statements.max | 1000 | configuration file
pg_stat_statements.save | on | configuration file
pg_stat_statements.track | all | configuration file
pg_stat_statements.track_utility | off | configuration file
port | 5432 | configuration file
random_page_cost | 2 | configuration file
replication_timeout | 1min | configuration file
seq_page_cost | 1 | configuration file
shared_buffers | 512MB | configuration file
shared_preload_libraries | pg_stat_statements | configuration file
ssl | off | configuration file
stats_temp_directory | pg_stat_tmp | configuration file
superuser_reserved_connections | 20 | configuration file
synchronous_commit | local | configuration file
syslog_facility | local0 | configuration file
syslog_ident | postgres | configuration file
temp_buffers | 256MB | configuration file
temp_file_limit | -1 | configuration file
TimeZone | GMT | configuration file
timezone_abbreviations | AlmostAll | configuration file
track_activities | on | configuration file
track_activity_query_size | 4096 | configuration file
track_counts | on | configuration file
track_functions | none | configuration file
track_io_timing | on | configuration file
unix_socket_directory | /var/run/postgresql | configuration file
unix_socket_group | postgres | configuration file
unix_socket_permissions | 0777 | configuration file
update_process_title | on | configuration file
vacuum_defer_cleanup_age | 0 | configuration file
wal_buffers | 16MB | configuration file
wal_keep_segments | 100 | configuration file
wal_level | hot_standby | configuration file
wal_receiver_status_interval | 5s | configuration file
work_mem | 512MB | configuration file
(69 rows)
Edit2
ในที่สุดเราก็ติดตั้งเซิร์ฟเวอร์ใหม่ทั้งหมด (ตามที่ร้องขอโดยฝ่ายสนับสนุนของ Sophos) แต่ใช้รุ่นก่อนหน้าและดิสก์ขนาดใหญ่กว่า เห็นได้ชัดว่าเวอร์ชั่นเก่าใช้พื้นที่สำหรับ WAL น้อยกว่ารุ่นใหม่
จากความอยากรู้ฉันได้ตรวจสอบรุ่นและพารามิเตอร์ pgsql ที่ไม่ใช่ค่าเริ่มต้น 7 และฉันได้รับผลลัพธ์ที่แตกต่างกันมาก:
PostgreSQL 8.4.14 on i686-pc-linux-gnu, compiled by GCC gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973], 32-bit
และ
name | current_setting | source
---------------------------------+-----------------+----------------------
autovacuum_analyze_scale_factor | 0.0005 | configuration file
checkpoint_segments | 12 | configuration file
checkpoint_warning | 0 | configuration file
escape_string_warning | off | configuration file
fsync | on | configuration file
listen_addresses | * | configuration file
log_destination | syslog | configuration file
log_timezone | Europe/Zurich | command line
maintenance_work_mem | 1GB | configuration file
max_connections | 300 | configuration file
max_stack_depth | 2MB | environment variable
port | 5432 | configuration file
shared_buffers | 32MB | configuration file
standard_conforming_strings | off | configuration file
syslog_facility | local0 | configuration file
syslog_ident | postgres | configuration file
temp_buffers | 1024 | configuration file
TimeZone | UTC | configuration file
timezone_abbreviations | AlmostAll | configuration file
work_mem | 512MB | configuration file
(20 rows)
ดูเหมือนว่าฉันจะมีการเปลี่ยนแปลงค่อนข้างมากระหว่างสองเวอร์ชันนี้