Name | zram-advisor JSON |
Version |
1.1.1
JSON |
| download |
home_page | None |
Summary | zRAM status and setup tools |
upload_time | 2024-07-30 18:08:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
zram
zram service
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# zram-advisor: Check/Setup/Test zRAM Tool
`zram-advisor` can:
* Check on your running zRAM and report ill advised settings and zRAM effectiveness.
* Install `fix-zram` which can setup your zRAM and/or reload it with different parameters (e.g., for testing).
* Provide a browser bookmark file to be imported to help testing your settings.
> **Quick-start**:
* If running python 5.11+, install `pipx`, and install with `pipx install zram-advisor`
* else install `pip`, and install with `pip install zram-advisor --user`
* `zram-advisor` - reports on currently running zRAM
* **Unless it reports "NO zRAM"**, then remove your current zRAM solution
before calling with `--setup-fix-zram`.
* `zram-advisor --setup-fix-zram 2x 15g` - configures/starts zRAM w zRAM limit of the lesser
of 2x RAM or 15GiB (vary to please or omit to take default of 1.75x 12g).
**If unsure of zRAM effectiveness or best parameters, delay setup until zRAM is tested (read further).**
> **But, to first test whether zRAM works for well and, if so, make it permanent:**
* Load tested amount: `zram-advisor --load 3x 12g` -- configures zRAM as the minimum of 3xPhysicalRAM
or (vary as you wish).
* Test with your heaviest system work load (or possibly use the `--gen-test-sites` option below
to assist creating an artificial load).
* To remove if disappointed with zRAM:
* run `zram-advisor --unload` or simply reboot.
* remove `zram-advisor` with `pipx uninstall zram-advisor`.
* If your tested zRAM params work well, make it permanent with:
* `zram-advisor --setup-fix-zram 2x 12g` - installs `fix-zram`, loads zRAM per
your given parameters, and installs a systemd service to load on each start.
* `fix-zram --setup 3x 20g` - to set non-default values (vary to please).
> **Removal Steps -- More than 'pipx uninstall' may be needed.**
1. if `--setup-fix-zram` was done, run `fix-zram --unsetup`
to remove itself from `/user/local/bin` and to remove its systemd service
2. run `pipx uninstall zram-advisor`
## Checking Your Running zRAM
#### Checking with zram-advisor
Here is the sample output of `zram-advisor` w/o arguments on a system with zRAM running:
```
$ zram-advisor
[[ type CTL-C to terminate]]
Distro : Linux Mint 21.3
180 : vm.swappiness.................. in [150, 200]
0 : vm.watermark_boost_factor...... in [0, 0]
125 : vm.watermark_scale_factor...... in [125, 125]
0 : vm.page-cluster................ in [0, 0]
1.6G : zRAM.disksize.................. >= 1.4G
================ 410s ================
952.4M : Total Memory eTotal=2.2G/239%
830.2M/87% : Used eUsed=1.4G/155%
122.3M/13% : Available eAvail=800.7M/84%
zram0:
uncmpr: 814.5M limit=1.6G
cmpr: 158.5M/17% factor=5.14
RAM: 165.5M/17% most=240M/25% limit=0
```
* The top section shows key parameters for zRAM and suggested ranges (if it did not like those it would preface the range with "NOT in")
* The midsection shows traditional key memory stats on the left, and on the right, the "effective values":
* **eUsed**: amount of memory used if the compressed part in zRAM were expanded.
*In this example, we have more memory in use than we have physical RAM (thanks to compression).*
* **eTotal** and **eAvail**: projected "effective" numbers based on the current compression ratio; these become more accurate as the zRAM memory footprint increases. *In this example, in effect, we have 2.2G memory (not 952.4M) and the "available" RAM is nearly as much as physical RAM (although also using more RAM than physical RAM)*.
* The lower section are stats for each zram device .. typically, there is just one.
* **uncmpr**: amount of "original" memory stored by zRAM; its limit is officially called 'disksize' which is the name/value you see from `zramctl`.
* **RAM**: amount of physical RAM consumed by zRAM including overhead; **most**: largest RAM used since boot.
#### Checking with pmemstat
Another app (installable with `pipx` or `pip`) is `pmemstat``. The top of it sample output (on the same system as above) was:
```
14:41:39 Tot=952.4M Used=741.5M Avail=210.9M Oth=0 Sh+Tmp=8.7M PIDs=122
0.6/ker zRAM=210.2M eTot:2.2G/240% eUsed:1.5G/166% eAvail:705.7M/74%
cpu_pct pswap other data ptotal key/info (exe by mem)
9.8 945 100 195 1,239 T 122x --TOTALS in MB --
───────────────────────────────────────────────────────────────────────────
3.3 396 65 106 567 23x chromium
```
* You can see those same "effective" key memory stats, plus you can see kernel cpu% (i.e., the `0.6/ker`). Kernal CPU (most the swap process) can be significant, and that CPU cost is the primary "cost" of using zRAM).
## zram-advisor Options
```
usage: zram-advisor [-h] [-s] [-d] [-t] [--DB] [args ...]
options:
-s, --setup-fix-zram install "fix-zram" program and start zRAM
-d, --dump-fix-zram print "fix-zram.sh" for manual install
-t, --gen-test-sites print "bookmarks.html" to import to a web-browser for load test
-L, --load run "fix-zram --load [args ...]>" to test zRAM w/o any footprint
-U, --unload run "fix-zram --unload" to remove zRAM test
<
```
* **--setup-fix-zram** installs a programs `fix-ram` and creates a service called `fix-zram-init` to run it on boot.
* **--dump-fix-zram** prints the stock `fix-zram.sh` (e.g., so you can modify it) and install your modified script by running it (e.g., `bash my-fix-zram.sh`).
* **--gen-test-sites** prints a .html to imported into (most) browsers; then open folders of sites to manufacture memory demand (of browsers at least); disable memory saving options and extensions to be most effective.
**Notes:**
* do not install `fix-zram` if w/o uninstalling any competing tool to configure zRAM.
* `systemd` is required for loading zRAM per your specs on boot.
## Controlling zRAM with fix-zram
`fix-zram` is bash script bundled with `zram-advisor`. Its usage is:
```
fix-zram [--(load|unload|setup|unsetup)] [-n|--dry-run] [-cN] [N.Nx] [Nm|Ng]
where:
--{command} defaults to 'load' but can be one of:
load - remove any existing zRAM and load zRAM with optional params
unload - unloads any existing zRAM
setup - copy fix-zram to '/usr/local/bin' and setup service [dflt=no]
unsetup - remove '/usr/local/bin/fix-zram' and remove service [dflt=no]
-n,--dry-run - only print commands that would be executed
-c{integer} - set number of zram devices
{float}x - set zram-size to {float} * ram at most [dflt=1.75]
{integer}m - set gross zram-size to {integer} megabytes at most [dflt=12288m]
{integer}g - set gross zram-size to {integer} gigabytes at most
Currently fixed values are:
vm.swappiness=180
vm.watermark_boost_factor=0
vm.watermark_scale_factor=125
vm.page-cluster=0
zRam-swap-priority=100
```
### fix-zram Run-Time Commands
`load` and `unload` affect the running system but the effects do not survive reboot. So, these can be used for trialing zRAM.
* `load` sets the `vm.*` parameters shown by `zram-advisor`.
* `unload` and `load` remove preexisting zRAM if running. Removal only works if all memory stored in zRAM can be placed in RAM or another swap device.
Typical use:
* `fix-zram --load 3x 12g` - will unload the current zRAM (if exists and possible), and then install zRAM with sized at the minimum of 3x RAM and 12GB.
### fix-zram Setup Methods
* `fix-zram --setup` - installs `fix-zram` and creates a `zram-init-fix` service which will load zRAM per the defaults on each load with default values.
* `fix-zram --unsetup` - removes the installed `fix-zram` and removes the `zram-init-fix` service.
Typical use:
* `fix-zram setup 3x 12g` - installs a zRAM init service that start zRAM sized at the minimum of 3xRAM and 12GB on boot.
> The "fixed values" (shown in the usage section above) cannot be varied on the command line,
> but they are reasonable values w/o fretting much.
> If unacceptable, run `sudo nano /usr/local/bin/fix-zram` and adjust the values at the top of the script;
> be aware that another `zram-advisor --setup-fix-zram` will overwrite your changes.
Raw data
{
"_id": null,
"home_page": null,
"name": "zram-advisor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "zram, zram service",
"author": null,
"author_email": "Joe Defen <joedef@duck.com>",
"download_url": "https://files.pythonhosted.org/packages/fc/fc/f4c7a50c995dc93b1f352510e410a51aa66254b5f572958ef7ae764308d5/zram_advisor-1.1.1.tar.gz",
"platform": null,
"description": "# zram-advisor: Check/Setup/Test zRAM Tool\n`zram-advisor` can:\n* Check on your running zRAM and report ill advised settings and zRAM effectiveness.\n* Install `fix-zram` which can setup your zRAM and/or reload it with different parameters (e.g., for testing).\n* Provide a browser bookmark file to be imported to help testing your settings.\n\n> **Quick-start**:\n* If running python 5.11+, install `pipx`, and install with `pipx install zram-advisor`\n* else install `pip`, and install with `pip install zram-advisor --user`\n* `zram-advisor` - reports on currently running zRAM \n * **Unless it reports \"NO zRAM\"**, then remove your current zRAM solution\n before calling with `--setup-fix-zram`.\n* `zram-advisor --setup-fix-zram 2x 15g` - configures/starts zRAM w zRAM limit of the lesser\n of 2x RAM or 15GiB (vary to please or omit to take default of 1.75x 12g).\n **If unsure of zRAM effectiveness or best parameters, delay setup until zRAM is tested (read further).**\n\n> **But, to first test whether zRAM works for well and, if so, make it permanent:**\n* Load tested amount: `zram-advisor --load 3x 12g` -- configures zRAM as the minimum of 3xPhysicalRAM\n or (vary as you wish).\n* Test with your heaviest system work load (or possibly use the `--gen-test-sites` option below\n to assist creating an artificial load).\n* To remove if disappointed with zRAM:\n * run `zram-advisor --unload` or simply reboot.\n * remove `zram-advisor` with `pipx uninstall zram-advisor`.\n* If your tested zRAM params work well, make it permanent with:\n * `zram-advisor --setup-fix-zram 2x 12g` - installs `fix-zram`, loads zRAM per\n your given parameters, and installs a systemd service to load on each start.\n * `fix-zram --setup 3x 20g` - to set non-default values (vary to please).\n\n> **Removal Steps -- More than 'pipx uninstall' may be needed.**\n 1. if `--setup-fix-zram` was done, run `fix-zram --unsetup`\n to remove itself from `/user/local/bin` and to remove its systemd service\n 2. run `pipx uninstall zram-advisor`\n \n\n## Checking Your Running zRAM\n#### Checking with zram-advisor\nHere is the sample output of `zram-advisor` w/o arguments on a system with zRAM running:\n```\n$ zram-advisor \n [[ type CTL-C to terminate]]\n Distro : Linux Mint 21.3\n 180 : vm.swappiness.................. in [150, 200]\n 0 : vm.watermark_boost_factor...... in [0, 0]\n 125 : vm.watermark_scale_factor...... in [125, 125]\n 0 : vm.page-cluster................ in [0, 0]\n 1.6G : zRAM.disksize.................. >= 1.4G\n================ 410s ================\n 952.4M : Total Memory eTotal=2.2G/239%\n 830.2M/87% : Used eUsed=1.4G/155%\n 122.3M/13% : Available eAvail=800.7M/84%\nzram0:\n uncmpr: 814.5M limit=1.6G\n cmpr: 158.5M/17% factor=5.14\n RAM: 165.5M/17% most=240M/25% limit=0\n\n```\n* The top section shows key parameters for zRAM and suggested ranges (if it did not like those it would preface the range with \"NOT in\")\n* The midsection shows traditional key memory stats on the left, and on the right, the \"effective values\":\n * **eUsed**: amount of memory used if the compressed part in zRAM were expanded.\n *In this example, we have more memory in use than we have physical RAM (thanks to compression).*\n * **eTotal** and **eAvail**: projected \"effective\" numbers based on the current compression ratio; these become more accurate as the zRAM memory footprint increases. *In this example, in effect, we have 2.2G memory (not 952.4M) and the \"available\" RAM is nearly as much as physical RAM (although also using more RAM than physical RAM)*.\n* The lower section are stats for each zram device .. typically, there is just one.\n * **uncmpr**: amount of \"original\" memory stored by zRAM; its limit is officially called 'disksize' which is the name/value you see from `zramctl`.\n * **RAM**: amount of physical RAM consumed by zRAM including overhead; **most**: largest RAM used since boot.\n \n#### Checking with pmemstat\nAnother app (installable with `pipx` or `pip`) is `pmemstat``. The top of it sample output (on the same system as above) was:\n```\n14:41:39 Tot=952.4M Used=741.5M Avail=210.9M Oth=0 Sh+Tmp=8.7M PIDs=122\n 0.6/ker zRAM=210.2M eTot:2.2G/240% eUsed:1.5G/166% eAvail:705.7M/74%\n cpu_pct pswap other data ptotal key/info (exe by mem)\n 9.8 945 100 195 1,239 T 122x --TOTALS in MB --\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n 3.3 396 65 106 567 23x chromium\n```\n* You can see those same \"effective\" key memory stats, plus you can see kernel cpu% (i.e., the `0.6/ker`). Kernal CPU (most the swap process) can be significant, and that CPU cost is the primary \"cost\" of using zRAM).\n\n## zram-advisor Options\n```\nusage: zram-advisor [-h] [-s] [-d] [-t] [--DB] [args ...]\noptions:\n -s, --setup-fix-zram install \"fix-zram\" program and start zRAM\n -d, --dump-fix-zram print \"fix-zram.sh\" for manual install\n -t, --gen-test-sites print \"bookmarks.html\" to import to a web-browser for load test\n -L, --load run \"fix-zram --load [args ...]>\" to test zRAM w/o any footprint\n -U, --unload run \"fix-zram --unload\" to remove zRAM test\n<\n```\n* **--setup-fix-zram** installs a programs `fix-ram` and creates a service called `fix-zram-init` to run it on boot.\n* **--dump-fix-zram** prints the stock `fix-zram.sh` (e.g., so you can modify it) and install your modified script by running it (e.g., `bash my-fix-zram.sh`).\n* **--gen-test-sites** prints a .html to imported into (most) browsers; then open folders of sites to manufacture memory demand (of browsers at least); disable memory saving options and extensions to be most effective.\n\n**Notes:**\n* do not install `fix-zram` if w/o uninstalling any competing tool to configure zRAM.\n* `systemd` is required for loading zRAM per your specs on boot.\n\n## Controlling zRAM with fix-zram\n`fix-zram` is bash script bundled with `zram-advisor`. Its usage is:\n```\nfix-zram [--(load|unload|setup|unsetup)] [-n|--dry-run] [-cN] [N.Nx] [Nm|Ng]\nwhere:\n --{command} defaults to 'load' but can be one of:\n load - remove any existing zRAM and load zRAM with optional params\n unload - unloads any existing zRAM\n setup - copy fix-zram to '/usr/local/bin' and setup service [dflt=no]\n unsetup - remove '/usr/local/bin/fix-zram' and remove service [dflt=no]\n -n,--dry-run - only print commands that would be executed\n -c{integer} - set number of zram devices\n {float}x - set zram-size to {float} * ram at most [dflt=1.75]\n {integer}m - set gross zram-size to {integer} megabytes at most [dflt=12288m]\n {integer}g - set gross zram-size to {integer} gigabytes at most\nCurrently fixed values are:\n vm.swappiness=180\n vm.watermark_boost_factor=0\n vm.watermark_scale_factor=125\n vm.page-cluster=0\n zRam-swap-priority=100\n```\n### fix-zram Run-Time Commands\n`load` and `unload` affect the running system but the effects do not survive reboot. So, these can be used for trialing zRAM.\n* `load` sets the `vm.*` parameters shown by `zram-advisor`.\n* `unload` and `load` remove preexisting zRAM if running. Removal only works if all memory stored in zRAM can be placed in RAM or another swap device.\n\nTypical use:\n* `fix-zram --load 3x 12g` - will unload the current zRAM (if exists and possible), and then install zRAM with sized at the minimum of 3x RAM and 12GB.\n\n### fix-zram Setup Methods\n* `fix-zram --setup` - installs `fix-zram` and creates a `zram-init-fix` service which will load zRAM per the defaults on each load with default values.\n* `fix-zram --unsetup` - removes the installed `fix-zram` and removes the `zram-init-fix` service.\n\nTypical use:\n* `fix-zram setup 3x 12g` - installs a zRAM init service that start zRAM sized at the minimum of 3xRAM and 12GB on boot.\n\n> The \"fixed values\" (shown in the usage section above) cannot be varied on the command line,\n> but they are reasonable values w/o fretting much.\n> If unacceptable, run `sudo nano /usr/local/bin/fix-zram` and adjust the values at the top of the script;\n> be aware that another `zram-advisor --setup-fix-zram` will overwrite your changes.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "zRAM status and setup tools",
"version": "1.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/joedefen/zram-advisor/issues",
"Homepage": "https://github.com/joedefen/zram-advisor"
},
"split_keywords": [
"zram",
" zram service"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0dba3ef2c3bfd6f2d1e7d1bdfbceeb57be566a7109f12c85e8b5989be6746c93",
"md5": "b6a83b559e1d74e18534ecba745a776b",
"sha256": "f08271785e5850e5e0b9c517714a4c9153155e14aa53ce97f846c3fe4d4c9e93"
},
"downloads": -1,
"filename": "zram_advisor-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b6a83b559e1d74e18534ecba745a776b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 14380,
"upload_time": "2024-07-30T18:08:28",
"upload_time_iso_8601": "2024-07-30T18:08:28.073935Z",
"url": "https://files.pythonhosted.org/packages/0d/ba/3ef2c3bfd6f2d1e7d1bdfbceeb57be566a7109f12c85e8b5989be6746c93/zram_advisor-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fcfcf4c7a50c995dc93b1f352510e410a51aa66254b5f572958ef7ae764308d5",
"md5": "11feaa6c11009db2808d90e00ef90091",
"sha256": "8c0a673540c276c5ef0b9e1a76c003224de034052ecb73cbb232a2050caf7b18"
},
"downloads": -1,
"filename": "zram_advisor-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "11feaa6c11009db2808d90e00ef90091",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 17295,
"upload_time": "2024-07-30T18:08:28",
"upload_time_iso_8601": "2024-07-30T18:08:28.989459Z",
"url": "https://files.pythonhosted.org/packages/fc/fc/f4c7a50c995dc93b1f352510e410a51aa66254b5f572958ef7ae764308d5/zram_advisor-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-30 18:08:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joedefen",
"github_project": "zram-advisor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "zram-advisor"
}