Tech & Docs

Hi @thomas@social.okaris.de, ich schreib das bzgl. CPU/RAM-Last mal hier schnell.

Es kommt erstmal darauf an, welche Services Du auf welcher Maschine hast, um zu beurteilen, das ein angemessener AverageLoad ist. Grundsätzlich: soweit es läuft, lass es so. Der AverageLoad bezieht sich immer auf alle Kerne, kann diese aber auch unter Volllast übersteigen.

RAM

Es kann durchaus Sinn machen, einzelne Services zu beschränken, wenn diese sich sonst zu viele Ressourcen holen. Bspw. habe ich den Matrix-Service im RAM beschränkt. Dazu kann man einfach die Anweisung zum Service-File gesondert hinzufügen. Dazu: systemctl edit *dein.service* in diesem Falle also systemctl edit matrix-synapse. Dort habe ich wie folgt begrenzt:

[Service]

# https://github.com/matrix-org/synapse#help-synapse-eats-all-my-ram
Environment="SYNAPSE_CACHE_FACTOR=1.0"
MemoryAccounting=yes
MemoryMax=2500M

Man sieht die ordnungsgemäße Begrenzung dann auch wenn man systemctl status matrix-synapse.service aufruft:

 Active: active (running) since Fri 2019-02-22 11:31:27 CET; 5 days ago
 Main PID: 2830 (python)
    Tasks: 16 (limit: 4915)
   Memory: 1.9G (limit: 2.4G)

Anm: Ich schrieb vorher “MemoryLimit=”, dies ist jedoch deprecated, wenn auch noch funktional. Besser ist also “MemoryMax=” zu nutzen!

CPU

In einem anderen Fall, nämlich für den Service Invidious habe die CPU-Auslastung begrenzen müssen, da das Tool sonst ständig unter Volllast läuft. Eine Begrenzung führt hier aber nicht zu Performance-Einbußen. Um CPU zu limitieren, wieder den Service öffnen. In diesem Fall also systemctl edit invidious.service. Dort habe ich es wie folgt gemacht:

[Service]
CPUAccounting=true
CPUQuota=11%

Das war's schon.

Because I just needed to do that, here is how it works:

  • switch to the mastodon-user sudo su - mastodon

  • enter your live directory cd live

  • start the rails console RAILS_ENV=production bundle exec rails console

  • find the account of the user account = Account.find_by(username: 'theonewhoforgotthepw')

The output will be echoed on the screen, have a look. If the output is “nil”, then the user does not exist.

  • also find the user object user = User.find_by(account: account)

  • set the new password for the user user.password = 'dontforgetitagain'

The output will be the new password itself.

  • save it with: user.save!

  • Then you can logout of the rails console with exit and also exiting the mastodon user.

(Laptop used: Medion Akoya E6222)

1. On the old Windows system

Do the downloads

  • check if there are more then one partition and tell me if so
  • connect to fast internet
  • download Etcher and install it
  • download the Ubuntu system file (64-bit version)

Make the USB-Stick bootable (at least 4GB)

  • plug in the USB-stick (all files will be removed!)
  • open Etcher
  • select the USB-stick out of the device list
  • select the Ubuntu system file you downloaded (Download folder)
  • click the Thunder symbol to execute

2. Installing Ubuntu

Note: All data on the windows machine, including the system, will be erased!

Starting from USB

  • switch off the laptop
  • plug the USB-stick in
  • switch on the laptop holding F2
    • (F2 to enter BIOS menu; carefully with the settings there!)
  • under menu “boot” disable fastboot
  • under menu “abvanced” enable usb legacy
  • save & exit – Note that the last 4 may vary depending on your laptop model and manufacturer!
  • restart and now press F10 to enter boot menu
  • choose ths USB stick to boot from (it should then say “Press any key to boot from USB.”
  • then you fill see the Ubuntu system installer opening screen
  • select the language and choose Install Ubuntu

Image – choose to download Updates while the installation runs, including 3rd party applications (select it unlike in the screenshot)

Image – partitioning the HDD according to the picture – unlike shown in the screenshot, select “Encrypt the new Ubuntu installation for security

Image – Put in your log-in credentials (Note: This is different from the system start password!)

Image – wait until the installation is complete

Image

Post-installation

Check out software you may need

  • first we update the system: follow the pop-ups first
  • open the termina and type sudo apt-get update && apt-get upgrade
  • enter your user-password (it won't be shown on the screen)
  • install VLC Media Player (via the AppStore)
  • check the AppStore for software you may need