Configure and Maximize Laptop on Ubuntu Desktop as Daily Marketing Activity.

Your new/first Tips, tricks and tutorial forum.
Post Reply
User avatar
admin
Site Admin
Posts: 24
Joined: March 7th, 2022, 1:09 am

Configure and Maximize Laptop on Ubuntu Desktop as Daily Marketing Activity.

Post by admin »

I would like to share my marketing activity using my Laptop:
hp EliteBook 2450p, using Ubuntu desktop 20.04.5 LTS.

Code: Select all

jerry@hp-2540p:~$ hostnamectl
   Static hostname: hp-2540p
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 1536efa361084xxxad8183c2aebaec8b
           Boot ID: a10be3562xxx475696f0911b3a271659
  Operating System: Ubuntu 20.04.5 LTS
            Kernel: Linux 5.15.0-56-generic
      Architecture: x86-64
jerry@hp-2540p:~$ 
Opening a lot of multiple tab at the same browser in my daily activity, As a marketer... this is a normal habit,
but most of the time...
We've got a lot of problems with our device,
such as:
> The laptop hang due too many open multiple tab,
> The laptop running effects... very slow,
> The laptop running very hot then shutdown unexpectedly.

To resolve the problems...

#1. Reduce the overheating:

There are two tools which you can use to reduce overheating
and thus get a better system performance in Ubuntu...
TLP and CPUFREQ.

Code: Select all

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo tlp start
To install CPUFREQ indicator use the following command:

Code: Select all

sudo apt-get install indicator-cpufreq
also...

Code: Select all

sudo apt-get install cpupower-gui
Restart your computer and use the ondemand mode in it.
and looks like this:

Code: Select all

jerry@hp-2540p:~$ cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us
  hardware limits: 1.20 GHz - 2.13 GHz
  available frequency steps:  2.13 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.20 GHz and 2.13 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.58 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    33999 MHz max turbo 4 active cores
    33999 MHz max turbo 3 active cores
    33999 MHz max turbo 2 active cores
    33999 MHz max turbo 1 active cores
jerry@hp-2540p:~$
#2. Install MSI Fan control within your Gnome Extention

Just start using it ondemand only (when the heat rise up)
For your reference:
https://extensions.gnome.org/

#3. update your Ubuntu grub using this configuration:

Make sure GRUB_CMDLINE_LINUX_DEFAULT asserted with "intel_pstate=disable acpi-cpufreq=enable"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable acpi-cpufreq=enable"

Code: Select all

sudo nano /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="0"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="20"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable acpi-cpufreq=enable"
GRUB_CMDLINE_LINUX=""
acpi_osi=Linux

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"
GRUB_GFXMODE="1280x800"
#GRUB_GFXMODE="1366x768"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to get a theme
export GRUB_COLOR_NORMAL="light-gray/black"
#GRUB_THEME="/usr/share/grub/themes/Tela/theme.txt"
# or
#GRUB_THEME="/usr/share/grub/themes/Stylish/theme.txt"
# or
#GRUB_THEME="/usr/share/grub/themes/Vimix/theme.txt"

# End default grub
Save file.

#4. Reduce Swappiness:
We want to change this swappiness value to 20. (8GB RAM)
To do this,
you will need to edit the sysctl.conf file.
Just enter the following command into the terminal to open the file:

Code: Select all

sudo nano /etc/sysctl.conf
Now add the line :

Code: Select all

vm.swappiness=20 
to the bottom of the file.
Save file and You should update the grub.

type in terminal:

Code: Select all

echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash && 
sudo update-initramfs -u && 
sudo update-grub
#5. Install Psensors, makes use of lm-sensors and hddtemp to get the temperatures:

Code: Select all

sudo apt-get install psensor
and setup preferences and sensor preferences with your device.

#6. Tweak ubuntu Linux for broadband

Add the following configuration in terminal with:

Code: Select all

sudo nano /etc/sysctl.conf

#(substituting your window size in place of 524288, if necessary):
# Tweaks for faster broadband...
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1
Then to have the settings take effect immediately, run:

Code: Select all

sudo sysctl -p
#7. MTU Setting

MTU stands for Maximum Transmission Unit and it is basically a parameter that determines the maximum size of data packets
that are allowed to be transferred from the network to your system.
If the MTU value is too small, then you are crippling your speed by dealing with large number of packages, and if it is too large, you are letting the data transmission occupy significant portions of your bandwidth for larger periods of time, essentially causing lag.
So, there is a golden ratio as in everything and if you want to squeeze the maximum performance out of your internet connection,
you can determine and set your MTU to an optimal value.
Open a new terminal session and start ping tests to see what the optimal MTU value is.
Use the following command:

Code: Select all

ping -M do -s 1470 google.com
Start with 1480 and drop 10 by 10 until you find the highest value
that is indicating 0% packet loss, using “Ctrl+C” to cancel each ping.
After you have determined the optimal MTU value, go to /etc/network/interfaces:

Code: Select all

sudo nano /etc/network/interfaces
And add a line “mtu 1470” without quotation marks "..."
(or whatever value you found as the best) and save the file.
Note that you need to open the configuration file as the system administrator
or else you won't be able to save your changes.

And make sure your esm-infra and Livepatch status are enabled:
For your reference:
https://auth.livepatch.canonical.com/?u ... buntu-user

Code: Select all

jerry@hp-2540p:~$ sudo ua status
[sudo] password for jerry:            
SERVICE          ENTITLED  STATUS    DESCRIPTION
esm-infra        yes       enabled   Expanded Security Maintenance for Infrastructure
fips             yes       disabled  NIST-certified core packages
fips-updates     yes       disabled  NIST-certified core packages with priority security updates
livepatch        yes       enabled   Canonical Livepatch service
usg              yes       disabled  Security compliance and audit tools

Enable services with: pro enable <service>

     Account: xxxxxxxxxx@emailprovider.com
Subscription: Ubuntu Pro - free personal subscription
jerry@hp-2540p:~$
Your Pro version:

Code: Select all

jerry@hp-2540p:~$ pro --version
27.12~20.04.1
jerry@hp-2540p:~$
and your pro security-status:

Code: Select all

jerry@hp-2540p:~$ pro security-status
2198 packages installed:
     1656 packages from Ubuntu Main/Restricted repository
     237 packages from Ubuntu Universe/Multiverse repository
     244 packages from third parties
     61 packages no longer available for download

To get more information about the packages, run
    pro security-status --help
for a list of available options.

Main/Restricted packages receive updates with LTS until 2025.

jerry@hp-2540p:~$ 
Last but not least... Turn on your air conditioner too, Make it cooler...
Hopefully, this will speed things up a bit without causing network data package errors,
and your daily marketing activity running smoothly as well.
Post Reply