how to disable internet when cpu too busy?

Moderators: 666philb, Forum moderators

Post Reply
boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

how to disable internet when cpu too busy?

Post by boof »

When my cpu usage gets too high, my computer freezes. yes, i fitted a fresh mouse battery. there's no gpu, the cpu does everything. it's an n6004? i can have libre office and firefox only open with one page each, and the internet suddenly ramps up usage and freezes the screen. i usually have to reboot manually to clear it. i'm open to other code solutions. nb with the network off and libre office only open, in one window: if left several hours, it freezes. i have 2GB of RAM. this should not happen. the screensaver is on @ 10min. in normal use i restart the graphical interface every 60-90min to prevent freezing. i have some 20 bookmarks for ff, the .doc file is up to 40 pages of text. crompton is off. i don't know whats happening.

User avatar
Flash
Moderator
Posts: 1037
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 60 times
Been thanked: 140 times

Re: how to disable internet when cpu too busy?

Post by Flash »

If your Internet is via Ethernet cable, you can try unplugging the cable to see what happens.

Chaos coordinator :?
User avatar
bigpup
Moderator
Posts: 7593
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1038 times
Been thanked: 1692 times

Re: how to disable internet when cpu too busy?

Post by bigpup »

You need to go into the browser settings/preferences and disable anything that can run in the background.

What web site is this usually open to?

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: 7593
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1038 times
Been thanked: 1692 times

Re: how to disable internet when cpu too busy?

Post by bigpup »

to temporarily disconnect internet connection.

Right click on the tray network icon.
Select Disconnect from network.

To reconnect

Right click on the tray network icon.
Select Reconnect to network.

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

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

i am disabled, and manually disconnecting the eth cable is not practical. usually its affected quicker by long internet pages with many listings or great detail. vis gumtree, youtube etc. upgrading hardware not possible atm. i don't know how to restrict pre-fetched pages, i'm browsing only, lower speeds are ok. i want to automate the disconnection by hi cpu use.

User avatar
mikeslr
Posts: 3147
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 187 times
Been thanked: 1018 times

Re: how to disable internet when cpu too busy?

Post by mikeslr »

Sorry, I don't know how to automatically disable internet when cpu is too busy. But perhaps the following considerations will help with your problem.

How much RAM does your computer have?
A Frugal Puppy moves information in and out of Cache --which AFAIK occupies RAM-- as and when that information is needed, or no longer needed.
I may be off base --someone with actual knowledge and experience can correct this-- but my experiment here, https://www.forum.puppylinux.com/viewto ... 4070#p4070 suggests that CPU is employed to perform that movement. When RAM is limited, more activity by CPU is required. Scan down to the cited post and note the where I reported the effects of entering "Cat Images" in Google's Search Box. In particular, note "Moreover, it was also reported that 8 Mbs of the 377 [of swap] has also been used. It should also be noted that it took about 3 minutes to load the web-page; and after it loaded it took over a minute for pup-sysinfo to complete and display its report."

Web-browsers are 'RAM hogs', even Seamonkey, the least resource demanding. And if you haven't taken steps to move Web-Cache automatically out of RAM, you have less RAM available to do anything other than store that Web-Cache.

Which firefox are you using. My impression is portables will require the less RAM than installed pets or even loaded SFSes. On the old Forum I posted the results of an exploration comparing LibreOffice installed, LibreOffice SFS-Loaded and LibreOffice run as a portable. Archiving, unfortunately, did not preserve much of the text. But fortunately, you can open the screenshot of the comparison from this post, https://oldforum.puppylinux.com/viewtop ... d9#p686093. Today I would have used different terminology. But perhaps you can get the gist.
And, yes, you can still run LibreOffice as a portable Application. One can be created by UExtracting a pet, mounting an SFS, or downloading a package direct from LibreOffice UExtracting it. Copy/Move the entire folder which would be located in /opt into a folder on /mnt/home. You'll have to create menu entries.

Which version of LibreOffice are you using? I didn't run tests and record the results: just employed PupSysInfo>Devises>Memory to check and relied on memory and impressions. My impression is that while versions 6 and 7 require more space on storage, they actually require less RAM than versions 4 and 5.

If all you need is a WordProcessor, have you tried Mike Walsh's TextMaker? https://mega.nz/folder/LShHgaCC#QKEiIMMQDVlvQPdJ5IHcWw. He's also packaged PlanMaker (spreadsheet) and Presentations as stand-alone applications which you'll find at the same location.

Edit: I've just read the posts following your OP. They weren't present when I started writing an answer. If you are NOT using portable firefox, the easiest (if only partial) solution would be to divert web-cache out of RAM. Sorry, I haven't been able to figure out how to configure firefox-quantum's setting to make this easier.
By default, firefox stores cache in a hidden (left-click rox's EYE to see it) folder in /root, to wit: /root/.cache/mozilla. File-browse and left-click rox's EYE to open and see it. Leave that window open. Left-Click the desktop-drive icon just above your taskbar which has an 'x' in its top-right corner. This is your Home-partition, auto-mounted on boot-up. Right-Click an empty space and from the pop-up menu select New>directory, and give it a name, e.g. web-cache.
Drag the aforementioned mozilla folder into it and select Move. Drag it back to /root/.cache and select Link(relative). Web-cache will then automatically be written to your storage media, no longer occupy RAM and thus providing you more available RAM to actually do anything.

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

thx, moved mozilla cache and set link. my ssd should cope well. can i increase my swap file? i am using a legacy laptop, and grub4dos does not obey pfix=RAM to start a new swapfile/savefile.

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

Re: how to disable internet when cpu too busy?

Post by bigpup »

Use this:
swapfile manager
https://oldforum.puppylinux.com/viewtopic.php?t=58615

NOTE:
When making a swap file using the Setup Wizard in Swapfile Manager.
Click on OK will seem to freeze.
It may take several minutes to make the file.
When complete, the Setup Wizard will close.

A true swap file.
The file should be named swapfile.
It should be located in /mnt/home/

If it is there as swapfile for the name.

The swapfile manager will just replace it with whatever you make it in swapfile manager.
It makes a swap file named swapfile.
It overwrites the old swapfile with the new one.
So, that changes the size.

If the original swap file is named something other than swapfile.
You will end up with two swap files.

If you only want one swap file.
In the Swapfile Manager turn off swap.
In a file manager (Rox)
Delete the old swap file, so you only have the new one.
In Swapfile Manager turn swap back on.
Done.

Also some info on the last page of the topic.

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
mikeslr
Posts: 3147
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 187 times
Been thanked: 1018 times

Re: how to disable internet when cpu too busy?

Post by mikeslr »

@ boof, don't believe the 'old-saw' that swap should be twice RAM.
@ bigpup, thanks for remembering jpeps' creation. I've provided link to it and your advice on in Advanced Software>System.
Edit: bigpup, I'll delete my post @ System. Discovered your post @ Advanced Software >Utilities. Consequence of reading the Forum from the Top down. Just got to it.

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

thx. nearly there. cpu still gets too busy, but less often.

i want to edit the default desktop picture, by clearing a section and adding some permanent b&w text.
pls advise where the wallpaper? is stored and its name so i can edit it.

edit
found it, but can't operate paint to edit copy properly. still have eom file.

Last edited by boof on Sun Sep 04, 2022 9:22 pm, edited 2 times in total.
User avatar
bigpup
Moderator
Posts: 7593
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1038 times
Been thanked: 1692 times

Re: how to disable internet when cpu too busy?

Post by bigpup »

All wallpaper is in /usr/share/backgounds

Find the image you are using or want to change.

Open it in Mtpaint program.

Edit as you like.

Best to set Rox file manager to display thumbnails.
That way, the image files will show in Rox, as small images, and you can easily see, what the image file looks like.

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

mimine
Posts: 163
Joined: Wed Aug 24, 2022 5:56 pm
Has thanked: 17 times
Been thanked: 15 times

Re: how to disable internet when cpu too busy?

Post by mimine »

boof wrote: Sat Sep 03, 2022 9:35 pm

When my cpu usage gets too high, my computer freezes. yes, i fitted a fresh mouse battery. there's no gpu, the cpu does everything. it's an n6004? i can have libre office and firefox only open with one page each, and the internet suddenly ramps up usage and freezes the screen. i usually have to reboot manually to clear it. i'm open to other code solutions. nb with the network off and libre office only open, in one window: if left several hours, it freezes. i have 2GB of RAM. this should not happen. the screensaver is on @ 10min. in normal use i restart the graphical interface every 60-90min to prevent freezing. i have some 20 bookmarks for ff, the .doc file is up to 40 pages of text. crompton is off. i don't know whats happening.

It's because you only have 2GB of RAM, and when the free memory is small, the cpu usage rises to 100% and freezes the computer.
So you need to have a swap file of 2GB .

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

pls, what is the process i need to stop to disable my ethernet connection? i think i will use a tsr to disable it when not using the browser. i've just deleted /usr/bin/dillo to stop it making automatic, periodic? calls to the web and jamming my cpu into overload. crude, but effective.

williams2
Posts: 1071
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 307 times

Re: how to disable internet when cpu too busy?

Post by williams2 »

Typing ifconfig in a terminal will tell you what networks you have.

ifconfig eth0 down will disable eth0

ifconfig eth0 up will enable eth0

ifconfig wlan0 down will disable wlan0

ifconfig wlan0 up will enable wlan0

or ifdown eth0 or ifup eth0

or ip or iw

You can put the line in a script, and run it when you want.

I use rfkill block wlan to disable my wifi.

You can run a script from a key press.

You can read the rate of transfer of a network. iftop would probably work.
Or the network transfer rate is probably in /proc or /sys

An application will often allow you to set a transfer rate.
For example wget --limit-rate=100k
or youtube-dl -r 100k

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

i want to automate it. pls what is the correct syntax for

while
do
[libreoffice active] [ipconfig eth0 down] [ipconfig eth0 up]
sleep 20
done

or

while
do
[cpu usage <=90] [ipconfig etho up] [ipconfig etho down]
sleep 20
done

edit#
made 2 scripts one for default browser with ifconfig eth0 up
and
one for default text editor with ifconfig eth0 down and florence
0em icons writer and browser deleted and replaced by scripts.
so i don't forget
thx.

boof
Posts: 587
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how to disable internet when cpu too busy?

Post by boof »

n0, no fix. there appears to be some housekeeping, sometime after a boot, which requires the internet. this mystery process overloads my limited processing capacity and stalls the screen. i will take off set time from utc but i doubt that's the problem. i haven't watch closely to note when it happens.. nb i never thought linux would do this. i believe i should be in complete control, and choose when and what updates/housekeeping is done. there are 2 future appointments scheduled,

my processor is a T4300 @ 2.1GHz dual core
what sort of SIMM goes with it, pls? i'll increase my RAM to 4GB.

edit sat noon
4GB RAM installed, swafie from 64MB to 512MB. some improvement.

<F5> made hotkey for console, can use <reboot> when mouse freezes next time.
usage still spikes hi, but drop back to lower base.

Slowly, slowly catchee monkey.

Post Reply

Return to “Fossapup64”