https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • b

    bastelfreak

    01/12/2023, 8:05 PM
    ok
  • b

    bastelfreak

    01/12/2023, 8:05 PM
    do you have autovacuum enabled?
  • a

    Anna Nesterova

    01/12/2023, 8:05 PM
    yes
  • a

    Anna Nesterova

    01/12/2023, 8:08 PM
    is there is way to wipe old facts manually?
  • b

    bastelfreak

    01/12/2023, 8:08 PM
    https://forge.puppet.com/modules/puppetlabs/pe_databases/readme has some code to configure pg_repack. that will clean up dead code. worth a try
  • b

    bastelfreak

    01/12/2023, 8:08 PM
    puppetdb has no history of facts. when a new factset is inserted, the old records are updated
  • a

    Anna Nesterova

    01/12/2023, 8:08 PM
    yeah i saw that, but not sure that might help in this specific case
  • a

    Anna Nesterova

    01/12/2023, 8:09 PM
    but i’ll try
  • b

    bastelfreak

    01/12/2023, 8:09 PM
    so a) your facts are huuuuge or b) you have a huge amount of dead data autovacuum didnt delete
  • b

    bastelfreak

    01/12/2023, 8:10 PM
    you can also check your nodes, run puppet facts show and check for unused information and disable them
  • a

    Anna Nesterova

    01/12/2023, 8:10 PM
    i think that’s b) because the DB size keeps growing constantly
  • b

    bastelfreak

    01/12/2023, 8:10 PM
    and if you have arrays or hashes as facts, ensure that their ordering doesnt change
  • b

    bastelfreak

    01/12/2023, 8:12 PM
    then install pg_repack and give it a try, check if you have IO bottlenecks and upgrade storage/ram, upgrade postgresql to 13, run pg_tune to optimize the postgresql.conf
    👍🏻 1
    👍 1
  • a

    Anna Nesterova

    01/12/2023, 8:12 PM
    thanks, will try that
  • b

    bastelfreak

    01/12/2023, 8:15 PM
    and I recommend starting pg_repack in a tmjx session or as systemd job, ot might run some time and in the worst comdition needs free disk space as big as the table it runs on
  • a

    Anna Nesterova

    01/12/2023, 8:16 PM
    sure
  • b

    bastelfreak

    01/12/2023, 8:16 PM
    and please report back, I would like to know if it helped
    🫡 1
  • k

    kenyon

    01/12/2023, 8:26 PM
    Copy code
    kenyon@beta ~ % cat /tmp/test.yaml
    ? /var/lib/kubelet/pods/d77877b3-f32a-4318-bec1-1f3cc1860b2c/volumes/kubernetes.io~local-volume/pvc-b2fd0dbc-000a-40c6-8f1c-71562ebee94c
    : available: 825.05 GiB
      available_bytes: 885885857792
    
    kenyon@beta ~ % irb
    irb(main):001:0> require 'yaml'
    => true
    
    irb(main):002:0> YAML.load_file('/tmp/test.yaml')
    => {"/var/lib/kubelet/pods/d77877b3-f32a-4318-bec1-1f3cc1860b2c/volumes/kubernetes.io~local-volume/pvc-b2fd0dbc-000a-40c6-8f1c-71562ebee94c"=>{"available"=>"825.05 GiB", "available_bytes"=>885885857792}}
  • a

    Anna Nesterova

    01/12/2023, 8:39 PM
    @bastelfreak and you know what? it did the trick
    Copy code
    public.factsets                                          | 118 MB
  • a

    Anna Nesterova

    01/12/2023, 8:40 PM
    thanks!
  • b

    bastelfreak

    01/12/2023, 8:40 PM
    hahahahaa
  • b

    bastelfreak

    01/12/2023, 8:40 PM
    well thats a difference
  • a

    Anna Nesterova

    01/12/2023, 8:40 PM
    hope it didnt break anything 😛
  • s

    Slackbot

    01/12/2023, 8:40 PM
    This message was deleted.
    c
    b
    • 3
    • 10
  • b

    bastelfreak

    01/12/2023, 8:41 PM
    you can always do
    puppet facts upload
    I think to reseed the database with facts
  • a

    Anna Nesterova

    01/12/2023, 8:42 PM
    well i tried to apply a catalogue which actually uses facts from puppetdb and nothing broke, so looks like all needed stuff is still there
  • v

    vchepkov

    01/12/2023, 8:43 PM
    is it PE ? This helps
    Copy code
    puppet_enterprise::enable_database_maintenance: true
  • a

    Anna Nesterova

    01/12/2023, 8:43 PM
    my one - not PE
  • b

    bastelfreak

    01/12/2023, 8:44 PM
    I can highly recommend the awesome #postgresql room at libera irc. they can explain all the autovacuum options and tune your config way better than I can
    🙏 1
  • v

    vchepkov

    01/12/2023, 8:45 PM
    Copy code
    # cat /etc/systemd/system/pe_databases-facts.service
    [Unit]
    Description=Service to repack PE database tables
    Wants=pe_databases-facts.timer
    
    [Service]
    User=pe-postgres
    Group=pe-postgres
    Type=oneshot
    ExecStart=/opt/puppetlabs/server/apps/postgresql/11/bin/pg_repack -d pe-puppetdb --jobs 2 -t factsets -t fact_paths
1...270271272...428Latest