energyi
Posts: 141
Joined: Tue Mar 24, 2015 9:39 pm

1 GB RAM Raspberry Pi 4 Optimization

Wed Jun 26, 2019 10:47 pm

If you are like me, you might not have gotten access to the higher GB Ram models because they were sold out. The 1 GB RAM version seems good in its own right; audio is surprisingly good! Purchased a 64 GB Class 10-UHS-1 microSDXC card which I am hoping can somehow make up for the reduced onboard RAM.

My question is, what is the best optimization strategy for the 1 GB RAM version. Swap disk? I can wait patiently until USB3 boot is available. I know it all depends on your use, so for this question desktop activities, web, youtube, VLC, ...

Thinking there might be a few on the forums with the same needs. Thanks in advance for any discussion with instructions for the dumb like me. ~smiles~
energyi

wren
Posts: 66
Joined: Mon May 28, 2018 9:06 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Wed Jun 26, 2019 10:53 pm

I can only assume the 1GB models were for NAS people who intended the device to be headless. 1GB was barely enough for a desktop environment a decade ago. You can certainly create a swap partition on an external drive connected to USB3. It's not optimal. I think the 2GB and 4GB models will be hard to find in the first few months. The 1GB model should be reserved for Raspberry Pi A only.

chwe
Posts: 116
Joined: Tue Jul 31, 2018 1:35 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 1:04 am

if you can't wait for having things on a USB drive keep /boot on the sd card and move the rest to your USB attached storage, there should be plenty of tutorials how to achieve that.. (mostly for older RPis but that should work as well).

for the ram part, you might look into zram (arch has the nicest wiki for such stuff)https://wiki.archlinux.org/index.php/Im ... m_or_zswap

and for the lazy people: https://packages.debian.org/sid/zram-tools

All my SBCs run with 50% of ram as ZRAM with a great performance boost for many usecases (but honestly no idea how it performs in desktop scenarios, I don't use my SBCs with displays.. :D )

gtechn
Posts: 156
Joined: Thu Jan 07, 2016 5:32 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 1:18 am

energyi wrote: If you are like me, you might not have gotten access to the higher GB Ram models because they were sold out.
I personally recommend buying from Newark element14. I ordered about 12 hours after launch but got a ship date of 7/5 (not bad - 9 days). They have stock shipping out in batches of 1500 every week, and because of their lesser brand recognition in comparison to PiHut/Pimoroni/Adafruit, there are higher odds they'll have some inventory available more quickly for you. Patience required, but better than waiting indefinitely.
energyi wrote:Swap disk?
Disabled by default, generally not recommended. I mean, you could try it, but it will generally offer little performance boost and will wear out your SD card much quicker. 1GB of RAM shouldn't be too bad, because after all, Raspbian Buster is designed to still run on the 1st-revision Model B Pis, which had 256MB of RAM (except for some super early 128MB models).

However, according to one of the engineers on this forum (really sorry I can't find it again), they recommend:
1GB RAM: Ideal for Headless operation
2GB RAM: General desktop (even with many Chromium tabs) - Also had most units made at launch
4GB RAM: "Heavy" work like compiling (an engineer here actually compiles code for the RPi on the RPi 4 4GB as his daily driver.)
wren wrote:The 1GB model should be reserved for Raspberry Pi A only.
Perhaps, but you can only buy a Model A+ with 512MB of RAM right now. Maybe a future Model A if RAM isn't too expensive.
wren wrote: I think the 2GB and 4GB models will be hard to find in the first few months.
I read somewhere (sorry, again, if someone DMs me with where it is from I will happily add it), the factories can make about 1000 RPi4s per hour. Not a joke. I wouldn't expect rarity to last too long.

W. H. Heydt
Posts: 10768
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 5:40 am

gtechn wrote:
Thu Jun 27, 2019 1:18 am
I read somewhere (sorry, again, if someone DMs me with where it is from I will happily add it), the factories can make about 1000 RPi4s per hour. Not a joke. I wouldn't expect rarity to last too long.
This is going back to the Pi3B launch... Production was 20K per day, for a while. The maximum *sustainable* rate was 15K/day. Those rates are for the Sony Pencoed factory. There are other factories elsewere, such as China and--specifically for the "local" markets--Japan and Brazil. The pre-launch supply was (IIRC) 150K boards. They sold 50K the first day and the entire 150K supply during the first week.

More recently, sales rates of 5 million per year have been mentioned. (That implies production rates of 100K/week, or 15K to 20K per day, depending on what sort of factory operating schedule is used. At Pencoed, last I heard, they don't make boards on the weekends because that's when they do machine maintenance.)

The initial mix of Pi4Bs has been said to be 60% 2GB model in the expectation that that is suitable for the majority of uses--desktop--with the 1GB suitable for headless uses and 4GB more for developer and serious programmers. In the initial rush by people who are actively in touch with RPF announcements, the purchase patterns are probably atypical, heavily favoring the 1GB (headless) and 4GB ("wow" factor) followed by people buying whatever they can get shipped ASAP.

On the whole, there will probably shortages for at least 2 to 3 months (perhaps as long as 6 months...that has happened with new Pi models in the past) and the spot shortages for several months after that. For something that so few people seem to have even heard of, Pis are amazingly popular.

User avatar
Gavinmc42
Posts: 3630
Joined: Wed Aug 28, 2013 3:31 am

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 6:56 am

I use PiCore for my headless stuff, it is very small.
There is a Desktop for it but PiCore fell behind in releases, that looks to be turning around now.

One thing about native Pi development is compiling things like the kernel is hard.
That should now be easier with the 4B4.
So things like making PiCore, Buildroot etc are sped up.

The older releases of PiCore TC Desktop ran really well on the 3B's.
Once a PiCore with Desktop is optimized for the Pi4 it should be smoking :D
And because it runs from ram, it is pretty bullet proof to power failures.

Buster on my new 4B1 is nice, but it has not been used in anger yet :D
Serious testing starts tonight.

Gentoo64 I run on 3B+'s works even better than the older Raspbian.
Even got a version of Blender working on it.
Waiting for the new Pi4 version of Gentoo64, will it be usable on the 4B1?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Moonmarch
Posts: 121
Joined: Thu Mar 07, 2019 1:34 am

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 8:18 am

If you are running several programs at the same time and your computer is less responsive, ram is not the problem, the CPU is the problem, you will see CPU utilization at 100%, which can potentially freeze your computer, talking about the RPI3B+ more specifically, perhaps on the RPI4 1gb of ram will slow the computer down instead of the CPU, hardware is not always the problem, the software can be the problem, you can't run YouTube full screen using Chromium, because of the web browser instead of the hardware, the ram is not being used 100%, the CPU is not being used 100% either.

I assume people will purchase the RPI4 1gb model because of the price, the reason why I need to switch to a Intel x64 computer is, because some websites are either not compatible with Chromium 32 bit ARM edition, or not compatible with Linux, for example bank websites, YouTube runs great on the RPI3B+, I actually use the epiphany web browser which loads faster compared to Chromium, epiphany is less compatible with websites which includes the RPI website.

MarkR
Posts: 154
Joined: Fri Jan 25, 2013 1:55 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 8:36 am

I sometimes use compressed RAM, e.g. "zram" to improve things on systems with low memory.

I haven't tried it on the latest distribution, but previously there was a package called "zram-config" which can be installed and will just set reasonable default settings for compressed ram.

Also remember that on the Pi, video memory is shared with the main memory, so you get less than 1Gb on the 1Gb model, some is used for video, I think the split it configurable in the rpi configuration program (or config.txt if you prefer).

Heater
Posts: 13111
Joined: Tue Jul 17, 2012 3:02 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 8:37 am

Moonmarch,

If you are running several programs at the same time and your computer is less responsive, ram is notcould be the problem, the CPU iscould be the problem,...

Typically when you are low on RAM Linux will start swapping data from RAM to some swap file. That makes memory access thousands of times slower. You machine can become very unresponsive.

If you have no swap enabled Linux will try and kill off what it suspects is a run away process that is consuming too much RAM. They may or may not be the one you would have chosen to shut down.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23382
Joined: Sat Jul 30, 2011 7:41 pm

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 8:53 am

This is a weird thread. For the last 6 years 1GB has been all you had, all of a sudden we are looking for new optimisations for the 1GB Pi4?

Anything used to optimise on the previous models will work on the 1GB Pi4.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 12:11 pm

I second what jamesh said.

And as for wren's claim that "1GB was barely enough for a desktop environment a decade ago.", well that very much depends on the OS and desktop you're using as well as what software you're running on top of that desktop.

Go back further and you have desktops that run in MB (or evene KB). Granted they don't have all the eye candy of modern desktops but they're no less usable for that. They don't have the bloat either. (I've never got to the bottom of which drives which: does OS bloat drive RAM growth or the other way around?)
This space unintentionally left blank.

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 12:15 pm

wren wrote:
Wed Jun 26, 2019 10:53 pm
I can only assume the 1GB models were for NAS people who intended the device to be headless.
I disagee.

If my budget for rebuilding my NAS wasn't so tight I'd have gone with the 4GB model. More RAM = more file cache = faster NAS performance.
This space unintentionally left blank.

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 5:43 pm

I'm surprised that no-one has mentioned the obvious reason for the existance of a 1GB Pi4: hitting the $35 price point.

I'm sure that if thr RPF could have done 4GB and hit that price point they would have.
This space unintentionally left blank.

Moonmarch
Posts: 121
Joined: Thu Mar 07, 2019 1:34 am

Re: 1 GB RAM Raspberry Pi 4 Optimization

Thu Jun 27, 2019 5:45 pm

Heater, I've used zram the first month I started using the RPI, if you have a larger memory card, you can allocate more memory card space to be used as ram space, or swap space, I didn't mention zram, because the RPI needs to use more than 1gb of ram before using the swap space, here is the program I used to monitor ram utilization:

Code: Select all

sudo apt-get install htop

Code: Select all

htop
You will see how much ram is stored in swap space, which is a small amount, running thunderbird email with 2 chromium tabs open uses 600mb of ram, with CPU utilization at around 75%, running epiphany web browser with vlc media player while watching YouTube video at 720p uses 400mb of ram with 40% CPU utilization, what I'm trying to say is programs will use 200mb each, which is the reason why you will potentially not use more than 1gb of ram, didn't say every scenario uses less than 1gb of ram.

I suppose having more than 1gb of ram will be beneficial for websites such as Facebook or Amazon, these websites do run slow on Chromium wouldn't say unusable, increasing swap space will not increase computer response times noticeably when you are using these websites.

Return to “General discussion”