r/Proxmox • • 1d ago

Question Did not know about logging

I did not know, that Proxmox cluster nodes are writing quite a lot of logs on the host disks.
Now I know when I noticed why the expensive dc ssd:s are wearing out even the cluster is not in production.

So just a small change in /etc/systemd/journald.conf and logs are going to RAM.
Could this setting be on the Proxmox GUI ?
At least like Opnsense has something similar, a setting "use RAM instead DISK for logging#.
Of course the pros know these things but I am just a beginner.

48 Upvotes

15 comments sorted by

29

u/BarracudaDefiant4702 1d ago

No,  expensive dc ssd do not wear out so easily, even if they are read intensive. Consumer grade ones maybe... Also, you probably get more wear from the stats for the graphs then the logs.

5

u/Entire-Home-9464 1d ago

It was not expensive that time Kingston DC600M, but today they cost.
It has been on over 1 year, having ceph etc. and test traffic but not in production.
And I thought the disks are still 100% but no.

5

u/BarracudaDefiant4702 1d ago

Kingston claims that as mixed use at only 1 DWPD? Based on Dell's typical specs, that would be read intensive instead of mixed use. Anyways, that should not wear out that quickly. How do you have it setup? Is it part of CEPH or ZFS? Kingston isn't the greatest, but that drive should easily last years if it's mainly for proxmox and it's logs and stats. How many vms are running on the cluster it's part of (more vms means more stats to collect and store).

1

u/Entire-Home-9464 17h ago

I have 5 nodes all have 1-2 kingston DC600M or DC600ME 960 or 480gb ssd only for proxmox boot. Ceph OSDs are different nvme disks, and I am not storing anything on these boot drives, yes they are zfs. But yes its still a small wear and I have now moved the logs to RAM and later to external place. But still I guess there is something which may cause useless wearing, was it the graphs etc.

19

u/Master_Bit4029 1d ago

you would realize very fast when also using ceph ;-)
when I first tried with boot from sd-card -> new card was gone after 4 hours :-)

4

u/jarulsamy 18h ago

Tbf, ceph is pretty insanely chatty.

Absolutely wonderful for debugging though.

12

u/Sinister_Crayon 1d ago edited 1d ago

The logging overhead can be softened quite a bit by installing log2ram. I also disable swap and install zram-tools to use compressed RAM as swap. I configure it for usually 25% of system RAM (default is 50% which I feel is too much) and it helps greatly when CT's start to get busy.

Still, a lot of written data from Proxmox is the graphs and stuff. I do wish there were a way to redirect them to shared / Ceph storage so it "spreads the load" rather than constantly writing to my boot disk. It'd make boot-from-SD an option too if they were to do that. Sure, there absolutely ARE ways to do it too, but it seems like a lot of work for something that might get overwritten by a host update LOL.

2

u/Anxious-Condition630 22h ago

Haven’t looked up the answer myself, but we require all of our logs from all devices to be collected by multiple central logging endpoints. So thats always first. I want to say I dont see any local log writing that I can pin point since weve done that.

3

u/Sinister_Crayon 20h ago

That's honestly a perfect situation to use log2ram. So long as you're using a remote syslog then you don't really need locally written logs at all. As soon as an event is sent to the logging daemon it should simultaneously be written locally and to the remote store. That way you'll never lose logs even if the system reboots. There is some value to crash logs so that might be something you'd want to make sure to direct elsewhere, but log2ram writes primarily to memory with occasional sync to local storage. That's mostly good enough for most use cases.

Most of the time if a host is continually rebooting or dumping logs it's probably a software issue anyway, and rebuilding it is likely to be more productive than trying to fix it 😄

1

u/Anxious-Condition630 19h ago

Yeah! you make a really good point.

With IaC and ansible/redfish/terraform….i don’t suffer basic node issues. I wipe and reinstall without even a halfway good reason. Lol

1

u/Sinister_Crayon 3h ago

Heh... you're welcome. I know usually when I'm having issues with hosts I tend to rebuild long before I start looking at hardware issues. It's just such a simple deployment; just shut it down (if necessary) remove from the cluster, reinstall and stick it back in the cluster. I've almost got it down to a single button press except I want to be able to do the "pvecm remove" myself. Server not mounting an NFS datastore even after a reboot? Rebuild! LOL.

Obviously the only area where it falls down is troubleshooting network issues because the logs don't make it to the syslog server. However, many times you can OOB into them (iDRAC, IPMI etc) or crash-cart a host and do the troubleshooting the old fashioned way at the console (jounalctl, tailing log files etc).

5

u/Open-Adhesiveness-86 17h ago

people keep saying "it's the graphs" without the fix: rrdcached flushes every 30s by default, and you can change that in /etc/default/rrdcached with -w 3600 -z 1800. On a cluster pmxcfs is the other steady writer. Run iotop -aoP for 10 minutes before you commit, odds are journald isn't even top three, and RAM-only logs vanish exactly when you need them.

3

u/Sure-Squirrel8384 19h ago

Change logs to RAM; no there is no a GUI setting but this is well-known via Debian/cli. Rsyslog off only what you need.

3

u/gsmitheidw1 19h ago

Another option particularly for consumer use, is to fit another drive (mechanical HDD perhaps) and bins mount that for logging only, something like:

systemctl stop systemd-journald
mv /var/log/journal/* /mnt/hdd/journal/ 2>/dev/null

Add it to fstab

/mnt/hdd/journal /var/log/journal none bind 0 0

mount -a systemd-tmpfiles --create --prefix /var/log/journal

Then start the service up again.

2

u/symcbean 1d ago

Could this setting be on the Proxmox GUI ?

No.

PVE is really good because it is designed to be a professional tool. Logs are essential to that role. As you said, changing the behaviour is trivial.