We are testing 64-bit OS bullseye and noticed large virtual memory usage by Node-RED (more than 10GB), compared to 200MB virtual memory usage of 32-bit OS. See attached pictures of 32-bit OS vs 64-bit OS node-RED virtual memory usage.
After testing for a month, 64-bit OS provides better performance than 32-bit. Continuous writing to InfluxDB with large amount of data per second can cause RPI4 4GB version CPU and memory overload in 1 day and half. Switching to 64-bit OS and 64-bit InfluxDB, continuous writing to RPI4 2GB version can go up to 3 days.
So it is worth upgrading to 64-bit OS for RPI 4 with 2GB memory and above.
4 sensors at 3.2KHz sampling rate in parallel. Write data to influxDB in batch (grouping data points together and write in batch. Otherwise the database will have problem much earlier.)
In real applications, we use faster micro SD card than the one in testing.
Hard disc or SSD is not ideal for industrial environments, where the micro SD cards are installed inside the wireless gateways that could have tough conditions. Yes we use hard drives or SSDs for servers inside the control room.
Use a good, branded make such as the Samsung EVO and EVO Pro. The main thing to look for is a card that has built-in wear levelling. Most of the cheap cards don't.
Specify a card that is significantly oversized for the application. That way the wear levelling will work to your best advantage.
Schedule card replacements. Ensure that all of the cards get replaced on a schedule. For home use I've had cards last well over 6 years but under heavy use this is likely to be less.
Obviously, you will want to have spare cards in stock and have them preprepared ready to slot in. You may want to consider a simple config script to ensure that the card can be made production ready with all software updates and device specific settings with minimal effort.
We have been using Sandisk Micro SDs since 2015 and have excellent results. Very reliable in environments that temperature goes more than 70 degree Celsius in the summer (under direct sunshine in metal structure), and minus 30 degree Celsius in the winter.
You are right that extra card space gives extra life, since there is algorithm that writes to the card intelligently to reduce the wear and tear.
There are different reasons for 32-bit and 64-bit OS. At the testing, we used InfluxDB 1.8.10 for both 32-bit and 64-bit OS.
32-bit InfluxDB is installed at 32-bit Bullseye OS RPI 4 4GB, 64GB 70MB/s fast card. 64-bit InfluxDB is installed on 64-bit Bullseye RPI 4 2GB with 32GB 10MB/s slow card. So the hardware set up of the 64-bit system is inferior to the 32-bit system.
For 32-bit OS and database, the problem could happen after 1 and half day (Please note that the DAQ duration is much longer than our recommended system usage limit. Typical system usage is a few minutes per hour. )
For 64-bit OS and database, the failure may be due to the reason that the system run out of space.
At the end of the 3rd day, the database size is more than 25GB. The card space is only 32GB. When we add the virtual memory size of 10GB and database size of 25GB, the total is more than 32GB. After 3 days, database read and write still work well. But the CPU will go more than 100% usage very often at idle state.