Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

-3 votes
0 answers
61 views
Extremely Slow Internet Speed on Fresh Kali Linux Install (Only Getting KB/s)
I just installed Kali Linux recently, and I’m facing weird internet issues. When I check my speed on fast.com, it shows around 7–10 Mbps, but whenever I actually try to download anything (like using wget, apt-get, or browser), the speed drops to around 1–2 Mbps or even less. Sometimes it’s just in K...
I just installed Kali Linux recently, and I’m facing weird internet issues. When I check my speed on fast.com, it shows around 7–10 Mbps, but whenever I actually try to download anything (like using wget, apt-get, or browser), the speed drops to around 1–2 Mbps or even less. Sometimes it’s just in KB/s. Here’s what I know: * Same Wi-Fi connection gives full speed on Windows and mobile. * No VPN or proxy is being used. * Happening on both terminal and browser downloads. * Using built-in Wi-Fi adapter on a fresh Kali install. What could be throttling the real download speed on Kali? Is it a driver issue, DNS problem, or something else? 1
Narci (11 rep)
Jul 30, 2025, 04:28 PM • Last activity: Aug 4, 2025, 08:04 AM
1 votes
1 answers
52 views
How can I see how much space was freed by trim on an SSD?
In my current setup, I have three different filesystems on two different SSDs: A FAT partition and a BTRFS partition on one drive, and ext4 on a second drive. When running `fstrim`, [the output is apparently](https://www.reddit.com/r/linuxquestions/comments/vaahg7/comment/ic1es8n/?utm_source=share&u...
In my current setup, I have three different filesystems on two different SSDs: A FAT partition and a BTRFS partition on one drive, and ext4 on a second drive. When running fstrim, [the output is apparently](https://www.reddit.com/r/linuxquestions/comments/vaahg7/comment/ic1es8n/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) [not very usable](https://superuser.com/a/1251947/277646) and basically each of those filesystems reports some meaningless value for the amount that got trimmed. Since truly [free space on an SSD contributes to its performance](https://cdn.mos.cms.futurecdn.net/3XW98AqWgfM956j5FGcodL.png) , at least for QLC NAND modules that use an SLC cache, I wanted to see if I could determine the impact of running fstrim. I know that utilities like df and duf, as well as lsblk provide usage information based on the filesystem, but are there any utilities that can show the drive sectors that are in use vs free? If my understanding of how TRIM on an SSD works is correct, then the filesystem will show reduced space immediately upon deleting a file, but those sectors are still considered in use by the SSD controller. After TRIM, those sectors would be freed. I'm hoping for a way to see the extent of that
Hari (130 rep)
Jul 27, 2025, 05:24 AM • Last activity: Jul 29, 2025, 09:28 AM
100 votes
8 answers
79168 views
Is there a way to determine the optimal value for the bs parameter to dd?
On occasion I've seen comments online along the lines of "make sure you set 'bs= ' because the default value will take too long," and my own extremely-unscientific experiences of, "well that seemed to take longer than that other time last week" seem to bear that out. So whenever I use 'dd' (typicall...
On occasion I've seen comments online along the lines of "make sure you set 'bs=' because the default value will take too long," and my own extremely-unscientific experiences of, "well that seemed to take longer than that other time last week" seem to bear that out. So whenever I use 'dd' (typically in the 1-2GB range) I make sure to specify the bytes parameter. About half the time I use the value specified in whatever online guide I'm copying from; the rest of the time I'll pick some number that makes sense from the 'fdisk -l' listing for what I assume is the slower media (e.g. the SD card I'm writing to). For a given situation (media type, bus sizes, or whatever else matters), is there a way to determine a "best" value? Is it easy to determine? If not, is there an easy way to get 90-95% of the way there? Or is "just pick something bigger than 512" even the correct answer? I've thought of trying the experiment myself, but (in addition to being a lot of work) I'm not sure what factors impact the answer, so I don't know how to design a good experiment.
user4443
Mar 17, 2011, 06:35 AM • Last activity: Jul 20, 2025, 07:04 PM
8 votes
1 answers
491 views
Is it worth the hassle and risk of reformatting an NVME to use 4K blocks on a ZFS pool created with ashift=12?
I recently upgraded the NVME drives on my workstation machine, from a pair of Samsung EVO 970 512GB drives to a pair of of Kingston Fury 2TB drives. All went well, and I even converted the machine from old BIOS boot to UEFI boot. No problem. However, I just noticed that the NVME drives are formatted...
I recently upgraded the NVME drives on my workstation machine, from a pair of Samsung EVO 970 512GB drives to a pair of of Kingston Fury 2TB drives. All went well, and I even converted the machine from old BIOS boot to UEFI boot. No problem. However, I just noticed that the NVME drives are formatted with 512 byte blocks rather than 4KiB blocks. I mistakenly assumed that they'd be 4K and didn't check.
# nvme list
Node         Generic    SN   Model               Namespace  Usage         Format    FW Rev
------------ ---------- ---- ------------------- ---------- ------------- --------- --------
/dev/nvme0n1 /dev/ng0n1 XXXX KINGSTON SFYRD2000G 0x1        2.00TB/2.00TB 512B + 0B EIFK31.7
/dev/nvme1n1 /dev/ng1n1 XXXX KINGSTON SFYRD2000G 0x1        2.00TB/2.00TB 512B + 0B EIFK31.7
# nvme id-ns -H /dev/nvme0n1 | grep Data.Size
LBA Format  0 : Metadata Size: 0   bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good (in use)
LBA Format  1 : Metadata Size: 0   bytes - Data Size: 4096 bytes - Relative Performance: 0x1 Better
I'm using partitions on these drives for GRUB BIOS boot (p1), ESP (p2), an mdadm RAID-1 ext4 /boot filesystem (p3) with lots of space for kernels & ISO images, swap space (p4), L2ARC (p5) and ZIL (p6) for a HDD zfs pool, and the ZFS rootfs (p7). The BIOS boot partition is obsolete now, since I've switched to UEFI but it resides in otherwise unused space before sector 2048 so isn't important. They're both partitioned identically.
# gdisk -l /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 3907029168 sectors, 1.8 TiB
Model: KINGSTON SFYRD2000G                     
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 9E7187C9-3ED2-46EF-A695-E72489F2BEC3
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 3907029134
Partitions will be aligned on 8-sector boundaries
Total free space is 143 sectors (71.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            2047   1007.0 KiB  EF02  BIOS boot partition
   2            2048         1050623   512.0 MiB   EF00  EFI system partition
   3         1050624         8390655   3.5 GiB     FD00  
   4         8390656       142608383   64.0 GiB    8200  Linux swap
   5       142608384       276826111   64.0 GiB    BF08  Solaris Reserved 2
   6       276826112       285214719   4.0 GiB     BF09  Solaris Reserved 3
   7       285214720      3907028991   1.7 TiB     BF00  Solaris root
Anyway, I created the ZFS pool with ashift=12 for 4KiB block sizes, so it's always going to be reading and writing in multiples of 4K at a time. What I want to know is if there will be a noticeable performance difference if I reformat the NVME drives to use 4K sectors? I know (roughly) how to do that using the nvme command while booted from a rescue image, but given the hassle involved and the amount of downtime, and the risk of losing data if I make a mistake or if disaster strikes during one of the periods when the ZFS pool is in a degraded state, I only want to do it if there is a significant benefit...significant, to me, meaning at least a 5 or 10% improvement, not just 1 or 2%. (I have backups of the root pool - multiple nightly backups in multiple locations - but I'd prefer to avoid restoring from backup) I don't care about performance for the ESP or /boot partitions. Swap & L2ARC might benefit. The ZIL rarely gets used and probably won't be noticable. The main concern is performance of the zpool partition itself.
cas (81872 rep)
Jul 15, 2025, 02:25 PM • Last activity: Jul 15, 2025, 05:23 PM
10 votes
3 answers
17526 views
Debugging boot performance issues in grub / before kernel logging starts
My PC takes a long time booting. I have reason to believe it is caused by delays after grub, but before kernel logging starts (booting takes 30 seconds, but `dmesg` messages have time stamps between `0.00000` - `9.34223`, details in [this post](https://unix.stackexchange.com/questions/499832/long-ti...
My PC takes a long time booting. I have reason to believe it is caused by delays after grub, but before kernel logging starts (booting takes 30 seconds, but dmesg messages have time stamps between 0.00000 - 9.34223, details in [this post](https://unix.stackexchange.com/questions/499832/long-time-spent-between-grub2-menu-before-kernel-boot)) . Are there any ways to debug what's going on? In particular: * Is there a way to make grub itself more verbose, or keep logs? * Are there any other processes between grub and the kernel logging that could be taking time? How do I debug those? I believe the question is not specific to my setup. But just in case, I'm running Ubuntu 16.10 and grub(2) **EDIT**: Following a suggestion by @TooTea, I set the debug=all environment variables which produced a lot of messages a la script/script.c:50 malloc 0x7a9a2ca0 that should not be a problem. Then there is one block of messages that coincide with a 8 seconds delay delay: kern/dl.c:56 Detecting ext2... lib/relocator.c:1397 chunks = 0x7a7e0ae0 lib/relocator.c:434 trying to allocate in ...-... aligned ... size ... lib/relocator.c:1198 allocated: ...+... lib/relocator.c:1409 allocated .../... lib/relocator.c:1410 chunks = 0x7a7e0ae0
sheß (311 rep)
Feb 25, 2019, 04:16 PM • Last activity: Jul 14, 2025, 06:03 PM
0 votes
1 answers
160 views
Speeding up curl in bash scripts
I'm using a Bash script to retrieve the Spotify album thumbnail from whatever I'm listening at the moment to show it as an image in `Hyprlock`. For this particular case, I'm using the command `curl` to retrieve the album cover image and store it in a separate directory. ```lang-sh ... if [ ! -f "sto...
I'm using a Bash script to retrieve the Spotify album thumbnail from whatever I'm listening at the moment to show it as an image in Hyprlock. For this particular case, I'm using the command curl to retrieve the album cover image and store it in a separate directory.
-sh
...
if [ ! -f "stored_file.jpg" ]; then
     curl $url -so stored_file.jpg
     echo "stored_file.jpg"
...
The thing is, whenever this condition is met, curl downloads the image, but it causes a lag spike, affecting all of the other widgets I implemented, which is not ideal. I wanted to know if there was a way to optimize curl, or use another similar command to download the image from the URL without having any performance issues. What I've already just managed to do is limit the use of curl as much as possible to not have lag constantly. But it doesn't help that it lags everything else so frequently.
ItsFireStorm (1 rep)
Dec 13, 2024, 10:11 AM • Last activity: Jul 11, 2025, 04:27 AM
3 votes
1 answers
1930 views
Why is DM-Integrity so slow compared to BTRFS?
I want to detect silent corruption of block devices similar to how BTRFS does that for files. I'd even like to do that below BTRFS (and disable BTRFS's native checksumming) so that I can tweak more parameters than BTRFS allows. DM-Integrity seems like the best choice and in principle it must be doin...
I want to detect silent corruption of block devices similar to how BTRFS does that for files. I'd even like to do that below BTRFS (and disable BTRFS's native checksumming) so that I can tweak more parameters than BTRFS allows. DM-Integrity seems like the best choice and in principle it must be doing the same thing as BTRFS. The problem is that it's incredibly, unusably slow. While sequential writes on BTRFS are 170+ MiB/s (with compression disabled), on DM-Integrity they're 8-12 MiB/s. I tried to match DM-Integrity parameters with BTRFS (sector size, hashing algorithm, etc) and I tried lots of combinations of other parameters (data interleaving, bitmapping, native vs generic hashing drivers, etc). The writes were asynchronous, but the speed was calculated based on the time it took for writes to be committed (so I don't think the difference was due to memory caching). Everything was on top of a writethrough Bcache, which should be reordering writes (so I don't think it could be BTRFS reordering writes). I can't think of any other reason that could explain this drastic performance difference. I'm using Debian 11 with a self-compiled 6.0.12 Linux kernel and sha256 as my hashing algorithm. My block layers are (dm-integrity or btrfs)/lvm/dm-crypt/bcache/dm-raid. **Is there a flaw in my testing? Or some other explanation for this huge performance difference? Is there some parameter I can change with DM-Integrity to achieve comparable performance to BTRFS?**
ATLief (328 rep)
Dec 30, 2022, 12:56 PM • Last activity: Jul 5, 2025, 07:08 PM
2 votes
2 answers
571 views
XRDP poor performance for streaming videos
I don't know what to do I spend around 2 weeks setting up XRDP. I have XRDP up and running with Xorg on a 64 core epyc 3 gen. and performance is terrible. The machine's main usage should be as a terminal server for YouTube videos, but it can't handle even a single session ( I am expecting 30). When...
I don't know what to do I spend around 2 weeks setting up XRDP. I have XRDP up and running with Xorg on a 64 core epyc 3 gen. and performance is terrible. The machine's main usage should be as a terminal server for YouTube videos, but it can't handle even a single session ( I am expecting 30). When the video is full screen, it's lagging and input lag is sometimes good but sometimes 10 seconds. Is there any way to increase performance? What I tried: 1. tried xorgxrdp and xorgxrdp-glamor (interestingly, without glamor it's responsive but not usable) 2. for test acceleration with AMD 5600xt - still same 3. server set up with tcp_send_buffer_bytes=4194304 and net.core.wmem_max = 8388608 4. max_bpp=24/32, use_compresion=true/false, crypt_level=none/high 5. audio: tried wia, pulse and pipewire 6. OS Rocky 9.6, Debian 11/12 I hope I didn't miss anything.
gertz (53 rep)
Jul 1, 2025, 07:31 AM • Last activity: Jul 2, 2025, 10:14 PM
0 votes
0 answers
41 views
XRDP RDP vs Remmina issues
Hello I use XRDP for multiuser and I have performance issue and connec issue. First, is about channel drdynvc if its set to TRUE I cannot connect from windows RDP client and can connect without issues from remmina. Second performance, for some reason if is drdynvc set to FALSE performance is terribl...
Hello I use XRDP for multiuser and I have performance issue and connec issue. First, is about channel drdynvc if its set to TRUE I cannot connect from windows RDP client and can connect without issues from remmina. Second performance, for some reason if is drdynvc set to FALSE performance is terrible all is laggy, but if its TRUE it works perfectly, but I cant connect from windows RDP. I'm little bit sad about it. Do anyone have solution? system is Rocky 9 with xrdp xorgxrdp-glamor from repositores. Thank you.
gertz (53 rep)
Jun 30, 2025, 10:05 AM • Last activity: Jun 30, 2025, 01:38 PM
0 votes
1 answers
1953 views
Running iperf in bidirectional mode goes slower than unidirectional
I used iperf to test throughput on box A and B, both 1Gbps NIC. I found: * A->B can reach 940 Mbps * B->A can reach 940 Mbps But with `iperf -d`, to test bidirectional transfers, the result is only about 670 Mbps, so what can cause this problem? Switch or router?
I used iperf to test throughput on box A and B, both 1Gbps NIC. I found: * A->B can reach 940 Mbps * B->A can reach 940 Mbps But with iperf -d, to test bidirectional transfers, the result is only about 670 Mbps, so what can cause this problem? Switch or router?
bugs king (101 rep)
Feb 14, 2017, 03:16 PM • Last activity: Jun 28, 2025, 10:01 AM
1 votes
1 answers
432 views
`pzstd` = parallelized Zstandard, how to watch progress in 4TB large file/disk?
I am brand new to `zstd`/`pzstd`, trying out its features, compression, benchmarking it, and so on. (I run Linux Mint 22 Cinnamon.) This computer has 32 GB RAM. The basic command appears to be working, but I found out it's not fully multi-threaded / parallelized: ```none # zstd --ultra --adapt=min=5...
I am brand new to zstd/pzstd, trying out its features, compression, benchmarking it, and so on. (I run Linux Mint 22 Cinnamon.) This computer has 32 GB RAM. The basic command appears to be working, but I found out it's not fully multi-threaded / parallelized:
# zstd --ultra --adapt=min=5,max=22 --long --auto-threads=logical --progress --keep --force --verbose /dev/nvme0n1 -o /path/to/disk/image/file.zst
As you can see for yourself, I am trying to compress my **NVMe 4TB drive** with only Timeshifts on its ext4 fs. Could you recommend me some tweaks to my zstd command, I would welcome it. But the real question here is how to make it multi-threaded / parallelized? *** I am trying this:
# pzstd --ultra -22 --processes 8 --keep --force --verbose /dev/nvme0n1 -o /path/to/disk/image/file.zst
because of this parallel version of ZSTD does not have apparently the --progress option. I need to find another way to watch it. 4TB will take some time and I don't intend to be totally blind. My tries with pv ended as not working properly. Please help, I'll appreciate it. Thanks.
Vlastimil Burián (30505 rep)
Oct 10, 2024, 09:22 AM • Last activity: Jun 18, 2025, 06:54 AM
1 votes
0 answers
107 views
sysfs missing CPU thermal_throttle information
**Background Information:** I'm running Ubuntu 24.04.1 LTS (Noble Numbat, kernel 6.8.0-51-generic) on an AMD Ryzen 9 7950X3D, and I'm investigating some odd behavior where the CPU governor/driver will ***lower*** the CPU frequency when under full load. Using the `performance` governor and the `amd-p...
**Background Information:** I'm running Ubuntu 24.04.1 LTS (Noble Numbat, kernel 6.8.0-51-generic) on an AMD Ryzen 9 7950X3D, and I'm investigating some odd behavior where the CPU governor/driver will ***lower*** the CPU frequency when under full load. Using the performance governor and the amd-pstate driver, here's what I'm seeing: | Load | 15 min Load Avg | CPU Temp | CPU Frequency | | | ---- | :-------------- | -------- | ---------------: | -------- | | Idle | 1.12 | 40.8 C | 5,759,000,000 Hz | 5.76 GHz | | Full | 33.02 | 58.5 C | 4,827,047,000 Hz | 4.83 GHz | I'm fairly confident that 58.5C isn't hot enough to cause thermal throttling on the CPU, but I'd like to be sure so that I know how to direct my investigation: - If it's thermal throttling, I'll get a better cooling system. - If it's not thermal throttling, I'll keep looking into configuration options [This post](https://unix.stackexchange.com/questions/477088/cpu-thermal-throttle-counters?newreg=280449e8db7b4d9395891d3e0fe2fa4a) suggests that I should be able to see throttling information in /sys/devices/system/cpu/cpu*/thermal_throttle/, however the thermal_throttle directory is missing:
/sys/devices/system/cpu/cpu0 $ file *
acpi_cppc:        directory
cache:            directory
cpufreq:          symbolic link to ../cpufreq/policy0
cpuidle:          directory
crash_notes:      regular file, no read permission
crash_notes_size: regular file, no read permission
driver:           symbolic link to ../../../../bus/cpu/drivers/processor
firmware_node:    symbolic link to ../../../LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/ACPI0007:00
hotplug:          directory
microcode:        directory
node0:            symbolic link to ../../node/node0
power:            directory
subsystem:        symbolic link to ../../../../bus/cpu
topology:         directory
uevent:           ASCII text, with very long lines (1212)
**The Question:** Why is this missing from sysfs, and how can I get the CPU throttling information?
JimXugle (11 rep)
Jan 16, 2025, 11:24 PM • Last activity: Jun 16, 2025, 12:37 PM
4 votes
1 answers
2201 views
Why 7z not using enough CPU?
CentOS 9. 3 vCPU VM with 4Gb RAM. I run a cron job with 7z compressing 35Gb data in 150 files `7za a -mx=9 -mmt=3 ...` RAM usage - 18%, disk queue is very small, CPU is 61% on average. Why not 100% ? How do I find the bottleneck? ``` sar -p -d 1 10 Linux 5.14.0-80.el9.x86_64 (logger) 30/04/22 _x86_6...
CentOS 9. 3 vCPU VM with 4Gb RAM. I run a cron job with 7z compressing 35Gb data in 150 files 7za a -mx=9 -mmt=3 ... RAM usage - 18%, disk queue is very small, CPU is 61% on average. Why not 100% ? How do I find the bottleneck?
sar -p -d 1 10
Linux 5.14.0-80.el9.x86_64 (logger)       30/04/22        _x86_64_        (3 CPU)

16:50:10          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:11         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:11          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:12         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:12          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:13        39.00  33832.00      0.00      0.00    867.49      0.04      0.95      1.90 sda

16:50:13          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:14         2.00      0.00     24.00      0.00     12.00      0.00      0.50      0.10 sda

16:50:14          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:15         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:15          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:16         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:16          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:17         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:17          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:18         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:18          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:19         2.00      0.00     12.00      0.00      6.00      0.00      0.50      0.20 sda

16:50:19          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:20         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

Average:          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
Average:         4.30   3383.20      3.60      0.00    787.63      0.00      0.91      0.22 sda
sar -p -u 1 10
Linux 5.14.0-80.el9.x86_64 (logger)       30/04/22        _x86_64_        (3 CPU)

16:50:26        CPU     %user     %nice   %system   %iowait    %steal     %idle
16:50:27        all     60.20      0.00      0.99      0.00      0.00     38.82
16:50:28        all     61.54      0.00      0.67      0.00      0.00     37.79
16:50:29        all     60.87      0.00      0.33      0.00      0.00     38.80
16:50:30        all     59.26      0.00      1.01      0.00      0.00     39.73
16:50:31        all     60.20      0.00      1.00      0.00      0.00     38.80
16:50:32        all     62.79      0.00      0.00      0.00      0.00     37.21
16:50:33        all     63.46      0.00      1.00      0.00      0.00     35.55
16:50:34        all     64.88      0.00      0.67      0.00      0.00     34.45
16:50:35        all     63.04      0.00      0.66      0.00      0.00     36.30
16:50:36        all     62.88      0.00      0.33      0.00      0.00     36.79
Average:        all     61.91      0.00      0.67      0.00      0.00     37.42
**EDIT** I found this doc: https://documentation.help/7-Zip/method.htm and it says "LZMA compression uses only 2 threads." which would explain what I observe on CentOS. But on Windows it uses 24 threads with LZMA.. Why?
Boppity Bop (169 rep)
Apr 30, 2022, 05:01 PM • Last activity: Jun 4, 2025, 07:03 AM
1 votes
2 answers
2195 views
USB speed bottlenecks (specifically while running virtual machine)
This question is mostly about USB performance on Linux, but more specifically performance issues when running virtualbox images off of my USB. I posted this on the virtualbox forum, but so far no one has helped me. **Details** I bought a new Kingston HyperX Savage 512 GB 3.1 USB stick. I copied a 15...
This question is mostly about USB performance on Linux, but more specifically performance issues when running virtualbox images off of my USB. I posted this on the virtualbox forum, but so far no one has helped me. **Details** I bought a new Kingston HyperX Savage 512 GB 3.1 USB stick. I copied a 150 GB file on it, verified the hash and it passed. I also verified the speed using: time $(sudo dd if=/dev/zero of=/home/host/mnt/testfile2 bs=1M count=1000 & sync) 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.69425 s, 284 MB/s real 0m3.883s user 0m0.002s sys 0m0.002s Other time it would be around 110 MB/s, but still I think performance is good enough for VirtualBox to run Ubuntu instance on it. Another benchmark shows the following: sudo hdparm -Tt /dev/sdd1 /dev/sdd1: Timing cached reads: 21882 MB in 1.99 seconds = 10973.39 MB/sec Timing buffered disk reads: 1204 MB in 3.00 seconds = 400.74 MB/sec What happens is that when I start the VirtualBox, there are pauses or lags happening. A virtual box log of a fresh start and shutdown is located at: https://pastebin.com/iC7kQ54J (cut beginning part out because it was too long). Based on my research, whenever there is lagging there are a lot of the following messages in VBox.log: 00:07:10.988753 AsyncCompletion: Task 0x007f65495ff9c0 completed after 16 seconds 00:07:17.981513 AsyncCompletion: Task 0x007f65495ffe80 completed after 23 seconds 00:07:17.989714 AsyncCompletion: Task 0x007f65495ff7c0 completed after 23 seconds 00:07:18.004043 AsyncCompletion: Task 0x007f65495ffec0 completed after 23 seconds 00:07:18.009427 AsyncCompletion: Task 0x007f65495fffc0 completed after 23 seconds 00:07:18.065390 AsyncCompletion: Task 0x007f65495ffd80 completed after 23 seconds 00:07:18.065474 AsyncCompletion: Task 0x007f65495ff840 completed after 23 seconds After googling around, it seems people are saying this has to do with I/O on the drive, but how can that be the case if I get a good performance on the drive during benchmarks? Am I bench marking wrong? Can you suggest a better method? Are there any other parameters which might be disabled which are causing virtual-box to have performance issues with my USB? There are no errors in dmesg on the host during a run of this virtual machine. Here is sudo lshw | grep -A26 -B10 Kingston for my USB: *-usb:1 description: Mass storage device product: HyperX Savage vendor: Kingston physical id: 6 bus info: usb@4:6 logical name: scsi8 version: 1.00 capabilities: usb-3.10 scsi emulated scsi-host configuration: driver=usb-storage maxpower=896mA speed=5000Mbit/s *-disk description: SCSI Disk product: HyperX Savage vendor: Kingston physical id: 0.0.0 bus info: scsi@8:0.0.0 logical name: /dev/sdd version: PMAP size: 468GiB (503GB) capabilities: removable configuration: ansiversion=6 logicalsectorsize=512 sectorsize=512 *-medium physical id: 0 logical name: /dev/sdd size: 468GiB (503GB) capabilities: partitioned partitioned:dos configuration: signature=6e13cd5d *-volume description: EXT4 volume vendor: Linux physical id: 1 logical name: /dev/sdd1 logical name: /home/host/mnt version: 1.0 serial: e953210a-43c2-4ba9-87ec-55ed8ab3c6ff size: 468GiB capacity: 468GiB capabilities: primary journaled extended_attributes large_files huge_files dir_nlink recover 64bit extents ext4 ext2 initialized configuration: created=2018-09-01 00:55:53 filesystem=ext4 label=datapartition lastmountpoint=/home/host/mnt modified=2018-09-01 12:50:22 mount.fstype=ext4 mount.options=rw,relatime,data=ordered mounted=2018-09-01 12:50:22 state=mounted Can anyone tell what could be the problem?
PurpleLizard (11 rep)
Sep 4, 2018, 03:12 AM • Last activity: May 27, 2025, 11:04 AM
1 votes
2 answers
2050 views
Is it possible to set niceness value of a program in advance?
I want my games and certain programs (such as WINE) to be automatically given a higher priority then everything else, and while I'm at it I probably want to adjust the niceness value of a few other things like my window manager to be given a higher priority as well. So is there any way to give a nic...
I want my games and certain programs (such as WINE) to be automatically given a higher priority then everything else, and while I'm at it I probably want to adjust the niceness value of a few other things like my window manager to be given a higher priority as well. So is there any way to give a niceness level to a program before starting it? So, for example, I want the Steam program to always be run at niceness level -20 to give it priority over everything else. I don't want to have to run it in the command line like this "nice -n -20 steam" every time. A script could work well enough I suppose for those programs, but that doesn't solve it for things like services. For example, I might want to change the nice value of my window manager, which is started by my display manager, which is started by a service.
Sol33t303 (123 rep)
Apr 27, 2020, 09:39 AM • Last activity: May 26, 2025, 06:04 AM
3 votes
3 answers
12321 views
How to get best video performance on Windows VM without gpu passtrough?
I'm using OpenSUSE as my main OS on work laptop (Ryzen 5850U, no additional GPU), however I need to have working Outlook desktop app, since some of our company communications are encrypted using S/MIME, which as far as I know is unsupported in OWA on systems other than Windows. We are using on-premi...
I'm using OpenSUSE as my main OS on work laptop (Ryzen 5850U, no additional GPU), however I need to have working Outlook desktop app, since some of our company communications are encrypted using S/MIME, which as far as I know is unsupported in OWA on systems other than Windows. We are using on-premise Exchange server. So I decided to setup Windows VM, I'm using libvirt for this. Here is my VM config:
RDPWindows
  350141fc-4158-43cc-afad-my-uuid
  
    
      
    
  
  8388608
  2097152
  8
  
    hvm
    /usr/share/qemu/ovmf-x86_64-ms-code.bin
    /var/lib/libvirt/qemu/nvram/RDPWindows_VARS.fd
  
  
    
    
    
      
      
      
    
    
  
  
    
  
  
    
    
  
  destroy
  restart
  destroy
  
    
    
  
  
    /usr/bin/qemu-system-x86_64
However I'm getting quite poor video performance, it is *usable* but definitely not convenient to use, so I'm wondering how to get better performance. I tried using https://github.com/Fmstrat/winapps , it gives slightly better performance, but there are visual bugs. I tried RDP with xfreerdp but it wasn't really better than SPICE. I have installed SPICE guest tools on that Windows.
mily20001 (51 rep)
Oct 5, 2021, 03:30 PM • Last activity: May 24, 2025, 08:06 AM
1 votes
1 answers
149 views
Installing Kali Linux on a external HDD, dual-booting with Windows 10
I have Oracle VM on my Windows 10 laptop and installed Kali Linux on it. But after using the VM several times, Kali Linux crashes and does not launch. So, I decided to install Kali Linux on an external HDD. What is the performance like, and what problems may I face? And is there another way to use K...
I have Oracle VM on my Windows 10 laptop and installed Kali Linux on it. But after using the VM several times, Kali Linux crashes and does not launch. So, I decided to install Kali Linux on an external HDD. What is the performance like, and what problems may I face? And is there another way to use Kali Linux and Windows together?
Daryush (331 rep)
May 10, 2025, 10:50 AM • Last activity: May 10, 2025, 11:31 AM
0 votes
1 answers
42 views
ldd /usr/bin/pg_restore gives error not a dynamic executable
I am trying to determine the libraries needed for `pg_restore` in the official `postgres:15` docker image, but when I run `ldd /usr/bin/pg_restore` inside the container it returns this error: `not a dynamic executable`. When I install the same postgres client version 15.12 directly in my VM, `ldd` w...
I am trying to determine the libraries needed for pg_restore in the official postgres:15 docker image, but when I run ldd /usr/bin/pg_restore inside the container it returns this error: not a dynamic executable. When I install the same postgres client version 15.12 directly in my VM, ldd works as expected. What could be wrong that ldd is not working properly on a docker container?
Ricardo Silva (103 rep)
May 6, 2025, 09:52 AM • Last activity: May 6, 2025, 10:04 AM
0 votes
1 answers
2057 views
Tiling Window manager performance issues i3wm. Is this wm specific or the environment?
I'm doing some development on a Raspberry Pi 4 with 4gb of ram. After about a week of using the default WM, lxde/openbox, I decided a really needed a tiling capability. So much better for development. I've always been a fan of DWM because it's fast and simple. However, in my brief experience with i3...
I'm doing some development on a Raspberry Pi 4 with 4gb of ram. After about a week of using the default WM, lxde/openbox, I decided a really needed a tiling capability. So much better for development. I've always been a fan of DWM because it's fast and simple. However, in my brief experience with i3wm, I like what I believe to be a unique feature when it comes to containerizing desktops. For example, if I'm on desktop 1, and open firefox, then I move to desktop 2 and open two terminals before firefox finishes loading, I want firefox on desktop 1. Not on 2 cluttering up my terminals. The problem is that i3wm is running stupid slow. It's driving me nuts. Does i3 have known performance issues compared to other tiling window managers? Is there a lighter alternative which still behaves as described above? Or is this some other type of issue? I haven't used i3 much but I'm pretty certain I used it about a decade ago without issue, on a desktop which at the time was probably significantly slower than a modern rpi.
mreff555 (131 rep)
Feb 24, 2021, 05:09 PM • Last activity: Apr 26, 2025, 04:09 AM
2 votes
0 answers
43 views
dm-crypt IOPS amplification
I have a ZFS pool comprising a mirror comprising two partitions encypted with `dm-crypt`. ``` $ zpool list -v data2 NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT data2 3.6T 1.00T 2.6T - - 0% 27% 1.00x ONLINE - mirror-0 3.6T 1.00T 2.6T - - 0% 27.5% - ONLINE luks-aaaaaaaaaaaaaaaa...
I have a ZFS pool comprising a mirror comprising two partitions encypted with dm-crypt.
$ zpool list -v data2
NAME                        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data2                       3.6T  1.00T   2.6T        -         -     0%    27%  1.00x    ONLINE  -
  mirror-0                  3.6T  1.00T   2.6T        -         -     0%  27.5%      -    ONLINE
    luks-aaaaaaaaaaaaaaaa   3.6T      -      -        -         -      -      -      -    ONLINE
    luks-bbbbbbbbbbbbbbbb   3.6T      -      -        -         -      -      -      -    ONLINE
I've been using iostat to monitor performance while scrubbing and noticed something funny about the IOPS figures:
$ iostat -dxy -N --human sda sdb dm-2 dm-3 10
[...]
Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util
dm-2          1862.50    232.5M     0.00   0.0%   11.22   127.8k   11.00    159.2k     0.00   0.0%    1.23    14.5k    0.00      0.0k     0.00   0.0%    0.00     0.0k    0.00    0.00   20.92  99.7%
dm-3          1859.80    232.2M     0.00   0.0%   11.21   127.8k   11.20    159.2k     0.00   0.0%    1.39    14.2k    0.00      0.0k     0.00   0.0%    0.00     0.0k    0.00    0.00   20.86  99.3%
sda            468.10    232.5M  1394.10  74.9%   10.73   508.6k   11.00    159.2k     0.00   0.0%    1.08    14.5k    0.00      0.0k     0.00   0.0%    0.00     0.0k    0.40    8.75    5.04  81.5%
sdb            467.00    232.2M  1392.50  74.9%   10.70   509.1k   11.20    159.2k     0.00   0.0%    1.27    14.2k    0.00      0.0k     0.00   0.0%    0.00     0.0k    0.40   12.25    5.02  81.8%
The rkB/s (data read per second) match between each device mapper device and its underlying disk. This is as expected. But the r/s (reads per second) column looks rather strange... If I understand correctly, I'm getting ~450 IOPS out of each disk. But are ~1800 IOPS recorded for each device mapper device! I'd have thought that reading a single disk block from the device mapper device would correspond to reading a single block from the underling device... Here's a graph of the IOPS over time. Orange/Blue lines are the disks, Yellow/Green lines are the dm-crypt devices. Read IOPS Another interesting thing is that the operations rate on one disk is dropping during the scrub, but not the other. Maybe that's fine, I don't know whether the layout of data on a device in a mirror vdev is literally mirrored or whether each device can have data laid out differently. But the other weird thing is that the IOPS of both device mapper devices are idential, rather than one being some multiple of one disk, and the other the same multiple of the other... My only idea is that this is something to do with differing physical sector sizes of the disks (4096), logical sizes (512) and the ZFS pool's ashift parameter (which I set to 12 to match the physical sector size of the disks). But 1800 is ~4× 470, not 8×, so I don't see the direct relation between the two figures...
Sam Morris (1355 rep)
Apr 17, 2025, 09:32 AM • Last activity: Apr 17, 2025, 11:03 AM
Showing page 1 of 20 total questions