Swap file causing very slow performance?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
loldigox
Posts: 20
Joined: Tue Feb 22, 2022 3:23 am
Has thanked: 27 times
Been thanked: 5 times

Swap file causing very slow performance?

Post by loldigox »

Hi everyone,

I've been using "Friendly FossaPup64" on a system for a couple months. I thought I had it in pretty reasonable working shape when I gave it to my wife to use as a replacement for a very old desktop that is now struggling to run Windows 10. Shortly before turning it over to her, I did a clean install and set up a Swap file of equal size as the RAM (4 GB). She complained from the start that it would often "hang," especially during Zoom meetings or web-browsing in Firefox. I noticed that when it would "hang", the red bars on the "gatotray v3.3" performance meter had gone to the top. After a minute or two, the red bars usually would subside, and everything would behave normally. Sometimes, though, it would hang and just not respond for a very long time, and sometimes it would shut itself off after a long time.

After a lot of spousal complaining, I took the system back and noticed that every few minutes it would do this, lasting a minute or two each time, then it would be back to normal. I remembered the Swap file, and wondered if it mattered. So I deleted the Swap file and rebooted, and have been using the thing for an hour or two, with many (19) tabs open in Firefox, trying to see if it would hang again. So far, removing the Swap file entirely seems to have fixed the problem.

(I jinxed myself - As I was writing this, I opened another couple tabs, including one for WeatherUnderground, which seems to be a particularly "heavy" web site full of ads and animation. The gatotray meter pegged, turned to solid red, then the entire system hung, with not even the system clock updating for over 15 minutes, at which point I powered it off and restarted the system.)

So, I seem to have found my system's limit. Around Firefox 20 tabs is too much, especially if some of the sites are heavy content. I can live with that; I was trying to break things just now.

Does this make sense? The recommendations regarding the swap file in the Getting Started and System Requirements forum doesn't really address what size swap file, if any at all, I should use for a system with 4 GB RAM.

Thoughts?

Here is more info about my system:
Puppy Version: friendly-fossa64-rc3 (based on fossapup64 9.5)
System specs:
RAM - 4 GB
Processor - Intel Pentium CPU N3510 @ 1.99 GHz
Product name: HP Pavilion 11 x2 Notebook PC
Installation: Frugal, on sda2

Thanks very much!

User avatar
davids45
Posts: 55
Joined: Mon Jul 06, 2020 2:09 am
Location: Chatswood, NSW
Been thanked: 8 times

Re: Swap file causing very slow performance?

Post by davids45 »

G'day,

4GB RAM sounds big enough to not bother with a swap file (I wish my computers had 4GB RAM :( ).

Is the Firefox cache set to a suitably small size?

Is this cache located outside the Save File area? Say, on a separate partition (e.g. on a sda3 partition for holding such temporary stuff assuming your hard-drive is normally sized)?

Have you tried setting up conky to watch the processes running and memory usage as all this happens?

David S.

geo_c
Posts: 2856
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 2151 times
Been thanked: 863 times

Re: Swap file causing very slow performance?

Post by geo_c »

loldigox wrote: Tue Apr 12, 2022 9:57 pm

Does this make sense? The recommendations regarding the swap file in the Getting Started and System Requirements forum doesn't really address what size swap file, if any at all, I should use for a system with 4 GB RAM.

Thoughts?

Here is more info about my system:
Puppy Version: friendly-fossa64-rc3 (based on fossapup64 9.5)
System specs:
RAM - 4 GB
Processor - Intel Pentium CPU N3510 @ 1.99 GHz
Product name: HP Pavilion 11 x2 Notebook PC
Installation: Frugal, on sda2

Just to put it in perspective. I use Fossapup64.9.5 to zoom for 5 hours at a time on laptops with 4gb of Ram, and usually have a swap file of 4gb set up just 'in case' it might be necessary, but the system almost never uses this file, and if it does it's usually something to the tune of 600mgb or smaller. During that time I might be viewing youtube videos over the zoom call while having multiple browser tabs open.

It's been my experience that if the system starts to use a swap file in a big way, it's going to be slow going now matter what. The machines I zoom with are all i3 processors or higher. Though I think I've been able to zoom ok on a dual core with a little lag here and there.

I also use conky as has been mentioned just to check in on the resources in real time.

I wish I could be more helpful, but I thought adding a little of my zoom usage experience might help determine whether it's really a matter of the swap or not. It seems possible it might be related to the graphics configuration.

geo_c
Old School Hipster, and Such

loldigox
Posts: 20
Joined: Tue Feb 22, 2022 3:23 am
Has thanked: 27 times
Been thanked: 5 times

Re: Swap file causing very slow performance?

Post by loldigox »

Thanks @davids45 and @geo_c. I'm learning to watch conky and gatotray carefully. I seem to be OK with half a dozen Firefox tabs open, but if I open many more, memory starts getting really low, and the CPU goes to 100% and everything hangs. Then I may be able to kill Firefox and recover, but if I do nothing, it seems to never recover. (At least that's how it's behaving with no swap file now.)

I'd like to experiment with different sizes of swap files, but I can't find how to get the pupswap utility to come up. Do I have to boot from the USB again, as if it's the first time to boot?

Related question, if I do boot from USB as if it's my first boot, how do I get any of the files I've saved in my PupSave folder back? I've read the docs several times, and it's not very clear to me (a linux noob) how that really works. I think I can open that PupSave folder from /dev/sda2, and find my files, but where do I copy them to? That's confusing to me. I'm not clear on what is permanent storage and what's in RAM that goes away when I shut down.

Thanks again from a beginner. :?

User avatar
bigpup
Moderator
Posts: 6827
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 868 times
Been thanked: 1469 times

Re: Swap file causing very slow performance?

Post by bigpup »

It is possible you discovered a bug in friendly-fossa64-rc3.

Zoom seems to be your big issue.

A guess, make sure you are using the latest version.
The CPU is at the minimum requirements.
Zoom support says better to have an i3, i5, or i7 CPU.

I assume you have tried lower level settings for Zoom.

You have friendly-fossa64-rc3 installed on the internal drive?
If yes.
Is it the only OS installed?
What format did you make the partition?
Was the install done to a freshly setup drive, new partitions, formatting?

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6827
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 868 times
Been thanked: 1469 times

Re: Swap file causing very slow performance?

Post by bigpup »

Using Firefox to test is OK.

But what a web site tries to do, when you connect to it, is all over the place.
Who really knows for sure what it is trying to do.
So it is hard to find a fix by going to a bunch of different web sites and loading them.
One site could be working normally.
Another site could be doing all kinds of stuff and no way of 100% knowing it is all working correctly, whatever it is doing.
If you go to web sites that want to constantly load videos and adds.
Those are always messing up for me on a computer with similar hardware to yours.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

one
Posts: 244
Joined: Sun Jul 12, 2020 7:53 am
Has thanked: 16 times
Been thanked: 59 times

Re: Swap file causing very slow performance?

Post by one »

loldigox wrote: Wed Apr 13, 2022 4:55 am

[...]
I'd like to experiment with different sizes of swap files, but I can't find how to get the pupswap utility to come up. Do I have to boot from the USB again, as if it's the first time to boot?
[...]

No, you don't need to boot from USB. The pupswap tool is part of running fossapup, so simply open a terminal and type:

Code: Select all

pupswap

Don't put the swapfile on a slow USB stick - but if I read your post correct you are using the internal drive (/dev/sda2)?

peace

User avatar
xenial
Posts: 504
Joined: Mon Jul 13, 2020 7:41 am
Location: Lincolnshire.UK.
Has thanked: 92 times
Been thanked: 41 times

Re: Swap file causing very slow performance?

Post by xenial »

As a performance enhancement on fossapup i disabled the picom and also the conky and it produced good results.

Have you tried with other browsers to see how they perform as i have noticed chromium based browsers are superior in terms of memory management than mozilla based ones.I had to stop using firefox eventually because of the memory usage and it was occasionally freezing the entire system up.

User avatar
mikewalsh
Moderator
Posts: 6028
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 736 times
Been thanked: 1896 times

Re: Swap file causing very slow performance?

Post by mikewalsh »

@loldigox :-

Now, then.

I can't really say anything about swap-files vs swap-partitions; never bothered with swap-files. I'm not even really the best person to be talking here at all, since I have RAM & storage coming out the wazoo - 32 GB RAM, 6 TB + of storage.....and I have around 64 GB of swap partitions scattered around the system, including one of 48 GB (this HP desktop insists on mirroring the entire contents of RAM in one contiguous lump during suspend/hibernate, regardless of the amount in use).

However; a couple of observations, if I may?

From what I know of modern browsers, to a man they are RAM hogs. As xenial says, although Chromium-based browsers - including Chrome - have always had a bad reputation for this, the Chromium Project have done a lot of work on memory-management in recent years, with the result that they're nowhere near as bad as they used to be.

Firefox, well; it's had its up & downs. What prompted me to switch to Chrome back in 2008 was a particularly rough spell where FF was leaking memory allocation like a sieve, allied to crashing multiple times a day whenever it felt like it.

One thing they all have in common nowadays, however, is tab 'sandboxing'. This means that every tab starts, and runs in, its own separate process. Of necessity, this soon eats up a shed-load of RAM once you have more than a few tabs open. And the current generation of coders are spoilt, lazy brats; they automatically assume that everybody is running bang-up-to-date, top-end hardware, with huge amounts of RAM and massive amounts of storage......and code accordingly. There is no attempt made now to keep code elegant, tidy and small.....the unspoken assumption is that everybody upgrades their hardware every couple of years, and that anything over 2-3 yrs old has been in the landfill/been recycled years hence.

IMHO, present-day coders live in "cloud-cuckoo land". :roll:

------------------------------------

Zoom is another kettle of fish. Until recently, it's been a large app anyway, occupying some 300 MB of RAM before you even start to use it; now, the Zoom developers, for some unspecified reason only known to themselves, have introduced elements of the Electron platform into the 'mix', adding another couple of hundred MB. In the unpacked state, the current release of Zoom occupies almost half-a-gigabyte by itself.

You could, for a long time, run the Zoom 'app' within the Chrome browser itself.....but Google are nixing this, by removing support for webapps from next month. So if you want Zoom, it's going to have to be the client app or nothing.

peebee tells me he's been able to get the current release of Zoom functional; I myself have not yet got around to figuring out what's needed for the 'portable' version to work. Personally, I don't really need it, since I have so many alternatives:-

  • Google 'Duo' - within the browser

  • Google 'Meet' (the spiritual successor to Hangouts) - in the browser

  • Skype (I gave up on the increasingly fussy client app a while back) - in the browser

  • Jitsi 'Meet' - browser AND client app (this auto-updates by itself)

  • WIRE - browser AND client app

I only got into packaging Zoom because so many people were requesting it during the height of the pandemic lockdowns; for myself, I really have no more need for it.

Mike. ;)

loldigox
Posts: 20
Joined: Tue Feb 22, 2022 3:23 am
Has thanked: 27 times
Been thanked: 5 times

Re: Swap file causing very slow performance?

Post by loldigox »

bigpup wrote: Wed Apr 13, 2022 4:55 am

You have friendly-fossa64-rc3 installed on the internal drive?
If yes.
Is it the only OS installed?
What format did you make the partition?
Was the install done to a freshly setup drive, new partitions, formatting?

Thanks @bigpup. Yes, I installed friendly-fossa64-rc3 as the only OS in a frugal install on the internal hard drive, which I completely wiped and repartitioned, removing Windows 10, which was running out of space on the 60 GB drive. I now have sda1, which is 100 MB VFAT EFI, and sda2, which is 59.5 GB, ext3. I carefully followed the instructions on the Getting Started and System Requirements forum for Installing Puppy to a UEFI Internal Drive.

I see lots of advice in other posts, most recommending I try a different browser, which I'll try next. Another post in Beginner's Help recently was about slow browsing, and several people recommended Chromium-based browsers, particularly Vivaldi. So I think I'll try that first.

Thanks again everyone!

williams2
Posts: 1058
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 302 times

Re: Swap file causing very slow performance?

Post by williams2 »

Usingearlyoom -r0 -m1 --avoid Xorg and no swapfile / partition,
Puppy doesn't crash when running out of free memory,
or run slow because of swap thrashing.

The configuration I have been using:

Code: Select all

earlyoom -r0 -m1 --avoid Xorg &

See: viewtopic.php?t=2980

User avatar
Wiz57
Moderator
Posts: 541
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 77 times
Been thanked: 98 times

Re: Swap file causing very slow performance?

Post by Wiz57 »

If I read your first post correctly, you've installed FossaPup alongside Windows, probably on an NTFS formatted hard drive...
In my experience, newer Puppy kernels in the 5.X series have substantial slowdowns with swap being on an NTFS hard drive!
(I primarily use ScPup 32) My solution was to roll back the kernel (vmlinuz) and the associated zdrv to 4.169 or so, and
the slowdown disappeared. I also noticed this slowdown just accessing an NTFS formatted drive with say Rox Filer or
PCManFM. After the kernel change, no slowdowns. I suspect problems with newer ntfs drivers. My old netbook only
has 1 gig RAM, with a 500meg swapfile...rarely does Puppy access the swap though. With 4 gig RAM, try running without
any swap file, in terminal, type "swapoff" and press enter.
Wiz

Signature available upon request

loldigox
Posts: 20
Joined: Tue Feb 22, 2022 3:23 am
Has thanked: 27 times
Been thanked: 5 times

Re: Swap file causing very slow performance?

Post by loldigox »

@Wiz57 No, I installed friendly-fossa64-rc3 as the only OS in a frugal install on the internal hard drive, which I completely wiped and repartitioned, removing Windows 10, which was running out of space on the 60 GB drive. I now have sda1, which is 100 MB VFAT EFI, and sda2, which is 59.5 GB, ext3. The swap file was on sda2, though I've deleted it now.

Now I'm trying a different browser, Vivaldi, rather than Firefox, to see if it will behave better and not hog so much memory. It sure would seem that 4 GB of RAM should be enough.

Thanks for your suggestions.

User avatar
bigpup
Moderator
Posts: 6827
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 868 times
Been thanked: 1469 times

Re: Swap file causing very slow performance?

Post by bigpup »

With the constant updating going on with browsers.

The specific version of the browser could be an issue.

They seem to take two steps forward and one step back, sometimes.

All browsers, have settings you can adjust, that does affect how they work.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
xenial
Posts: 504
Joined: Mon Jul 13, 2020 7:41 am
Location: Lincolnshire.UK.
Has thanked: 92 times
Been thanked: 41 times

Re: Swap file causing very slow performance?

Post by xenial »

I have the vivaldi browser running on my fossa64 and the memory usage is quite good and is in fact better than most browsers i have tried.
Chromium based browsers don't really need constant updating as they should last at least 6 point releases before things go wonky if at all.

Firefox 78esr even renders youtube well.
i try to keep software static if i can and the introduction of new code into the system via updates can sometimes upset the apple cart.

Clarity
Posts: 3653
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1539 times
Been thanked: 489 times

Re: Swap file causing very slow performance?

Post by Clarity »

Hi@loldigox This may seem unimportant to many here, but you have a 'modern' PC that came with Win10. And the Friendly you are using is a remaster of @666philb's FossaPup64.

When you setup your system drive, did you set it up as a MSDOS drive or a GPT (which the PC came pre-installed)?

This question will seem unimportant, but, I have been noticing some anomalies in modern OS behaviors because of this.

AND, although you may not have seen info as you say, there is tons of info on SWAP-partitions vs SWAP-files.There is nothing wrong with use of them in your system operation. For me and analysis done 2 decades ago, a system is better off with SWAP-partition for reason I wont address here. And, the 'standard' recommendation for a SWAP size is a 'minimum' amount to match your PC's ram-size...in your case a minimum of 4GB Linux swap-partition.

So, is it GPT? And are you willing to use GParted to carve a 4GB partition on your system drive?

This is a place to start testing. I have another simple recommendation that I use and have just recently tested to mirror the hardware arrangement you shown. PM me if you want further info.

User avatar
wizard
Posts: 1840
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2513 times
Been thanked: 597 times

Re: Swap file causing very slow performance?

Post by wizard »

@loldigox

One thing not yet discussed is your N3510 is a low powered cpu, far below Zoom's recommended power. When you start hitting the ceiling on processor power as well as ram capacity all sorts of bad things start to happen. You may be just expecting to much from that hardware.

wizard

Big pile of OLD computers

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: Swap file causing very slow performance?

Post by Phoenix »

Zoom can do just fine with these budget CPUs. Just not official support because 'super sauce' is needed to make it run. Just like with Windows 11 upping their standards A LOT. (I use a n3350)

Swap files/partitions are meant as a temporary substitute for RAM. If you're seeing frequent usage or thrashing you should get it checked out.
If its not clear as to why it's a temporary substitute, imagine a USB. As you can imagine its not rather fast. Maybe 10MB/s top. Now imagine using that as RAM. Its very slow as you can see. But if the entire RAM fills up and the kernel can't handle it, well you're going to have to hard reset the computer.

Also are you certain you haven't touched any about:config settings in firefox regarding cache? There are roughly 2 options that could be the problem regarding using memory itself as a cache:
1. You enabled it but forgot to set the limit. Firefox uses all the RAM for cache possibly. (Oops)
2. You enabled it but set the limit too high.

IRC: firepup | Time to hack Puppy!

loldigox
Posts: 20
Joined: Tue Feb 22, 2022 3:23 am
Has thanked: 27 times
Been thanked: 5 times

Re: Swap file causing very slow performance?

Post by loldigox »

Update: I downloaded Vivaldi from @mikewalsh's thread (viewtopic.php?p=3491#p3491) and have been using it for normal work for a couple days. It seems to be behaving better and not gobbling up all the memory I have. This may be the ultimate solution to my problem, and would indicate that my initial diagnosis and blaming of the swap file may have been off target.

Nevertheless, @Clarity encouraged me to set up a Linux swap partition, rather than swap file, and in trying to do so, I've run into an error with GParted, while trying to shrink my main partition to make room for a swap partition.

To recap, I have a frugal install on sda2. That drive currently looks like this in GParted:

Screenshot(11).png
Screenshot(11).png (67.06 KiB) Viewed 2003 times

(Actually, sda2 didn't have the lock icon because I figured out that I needed to run GParted from a live session booted from a USB flash drive. When I first tried this in a regular session, GParted wouldn't let me change the size, I think because I had booted from sda2. So I tried to resize it from a live session, but forgot to take a screenshot.)

When I tried to resize the sda2 partition to make room for a swap partition, I got the following errors from GParted:

Code: Select all

GParted 1.0.0

configuration --enable-libparted-dmraid --enable-online-resize

libparted 3.3

========================================
Device: /dev/sda
Model: ATA LITEONIT L8T-64L
Serial: 002338125219
Sector size: 512
Total sectors: 125045424

Heads: 255
Sectors/track: 2
Cylinders: 245187

Partition table: gpt

Partition Type Start End Flags Partition Name File System Label Mount Point
/dev/sda1 Primary 2048 206847 boot, esp fat32 EFI
/dev/sda2 Primary 206848 125044735 ext3 linux

========================================
Shrink /dev/sda2 from 59.53 GiB to 55.53 GiB 00:00:08 ( ERROR )

calibrate /dev/sda2 00:00:01 ( SUCCESS )

path: /dev/sda2 (partition)
start: 206848
end: 125044735
size: 124837888 (59.53 GiB)
check file system on /dev/sda2 for errors and (if possible) fix them 00:00:07 ( SUCCESS )

e2fsck -f -y -v -C 0 '/dev/sda2' 00:00:07 ( SUCCESS )

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

23203 inodes used (0.59%, out of 3907584)
2201 non-contiguous files (9.5%)
17 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 1483/41/0
1456209 blocks used (9.33%, out of 15604736)
0 bad blocks
2 large files

20032 regular files
2907 directories
0 character device files
0 block device files
0 fifos
86 links
250 symbolic links (238 fast symbolic links)
5 sockets
------------
23280 files
e2fsck 1.45.5 (07-Jan-2020)
shrink file system 00:00:00 ( ERROR )

resize2fs -p '/dev/sda2' 58224640K 00:00:00 ( ERROR )

resize2fs 1.45.5 (07-Jan-2020)
Please run 'e2fsck -f /dev/sda2' first.

I tried running 'e2fsck -f /dev/sda2' in a terminal window and then re-tried re-sizing in GParted, but still got the same error.

Suggestions? Thanks again.

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: Swap file causing very slow performance?

Post by Phoenix »

First, unmount your ext3 partition. Then fsck/e2fsck, your choice. Then you resize via GParted. If you still can't resize it, just create the swapfile on the partition instead and use that.

IRC: firepup | Time to hack Puppy!

Clarity
Posts: 3653
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1539 times
Been thanked: 489 times

Re: Swap file causing very slow performance?

Post by Clarity »

@loldigox, shows:

Code: Select all

e2fsck -f -y -v -C 0 '/dev/sda2' 00:00:07 ( SUCCESS )

then GParted shows:

Code: Select all

resize2fs -p '/dev/sda2' 58224640K 00:00:00 ( ERROR )

Could this be a

  • bug in Gparted (assuming v1.0)?

  • drive hardware issue?

  • human operational error?

Using GParted, I cannot recreate similar on an "unmounted' ext3 partition.

Post Reply

Return to “Beginners Help”