Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Dec 2023 19:56:21 +0100 (CET)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        void <void@f-m.fm>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: measuring swap partition speed
Message-ID:  <1439231787.9333.1703184981914@localhost>
In-Reply-To: <ZYRe3GFrf1fSIPjk@int21h>
References:  <D9C150E2-8453-463B-9A23-B0474D0AE390.ref@yahoo.com> <D9C150E2-8453-463B-9A23-B0474D0AE390@yahoo.com> <ZYRe3GFrf1fSIPjk@int21h>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_9332_1497520887.1703184981868
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

A bit weird that a simple dd is so slow.

Just a quick thought.
Are your partitions aligned properly?
Is other IO going on on the same time?
What does gstat say about %util, queue length and all the other stats while running the dd? Or "iostat -x -d 1".

Could you try if another disk has the same issues?

How is your disk connected? USB-to-SATA-adapter? Any output of dmesg?

Regards,
Ronald.

 
Van: void <void@f-m.fm>
Datum: donderdag, 21 december 2023 16:50
Aan: freebsd-fs@freebsd.org
Onderwerp: Re: measuring swap partition speed
> 
> On Wed, Dec 20, 2023 at 07:48:14PM -0800, Mark Millard wrote:
> 
> ># swapoff /dev/label/growfs_swap
> ># dd if=/dev/urandom of=/dev/da0s2b bs=8k count=250000 conv=sync status=progress
> >^C478830592 bytes (479 MB, 457 MiB) transferred 22.001s, 22 MB/s
> >60557+0 records in
> >60556+0 records out
> >496074752 bytes transferred in 22.790754 secs (21766491 bytes/sec)
> 
> 22MB/s is usable, I think. In my context, I'd be satisfied with that.
> My context differs from yours slightly in that yours is SSD and mine
> is spinning rust.
> 
> This is unusable:
> # dd if=/dev/urandom of=/dev/da0p4 bs=8k count=250000 conv=sync status=progress
> ^C11862016 bytes (12 MB, 11 MiB) transferred 40.063s, 296 kB/s   
> 
> because it's way too slow. Swap never gets fully reclaimed,
> thrashing happens, loads of other followon effects happen.
> The same partition formatted as ufs reports 113 MB/s. Multiple swap partitions
> have been tested, then converted to ufs. Results are the same.
> 
> There are no reported errors in smartctl. Long smartctl tests run monthly.
> 
> 5 Reallocated_Sector_Ct   PO--CK   100   100   050    -    0
> 9 Power_On_Hours          -O--CK   001   001   000    -    48992
> 196 Reallocated_Event_Count -O--CK   100   100   000    -    0
> 197 Current_Pending_Sector  -O--CK   100   100   000    -    0
> 198 Offline_Uncorrectable   ----CK   100   100   000    -    0
> 
> I can't find any hardware problem here. Possible workarounds, bearing in mind I'm not versant in C so it's not like I can fix this myself in code:
> 
> 1. swap as swapfile and not partition [a]
> 2. swap as nfs [b]
> 3. swapoff & swapon script running every minute [c]
> 4. just turn all swap off and reboot after crashing (undesirable)
> 5. use another OS that doesn't have this problem
> 
> [a] not tried yet, and i hope it works. Legacy info suggests swap as partition is usually
>      faster than filesystem-based swap. But the reverse might be the case here.
> 
> [b] also not tried. This, I imagine, would be filesystem only (I'm unsure a zfs volume can
>      be exported to look like a mountable partition to the client)
> 
> [c] https://github.com/Freaky/swapflush.git - usually works but maybe i need to run it every      minute instead of every five mins. For testing, this script was disabled.
> 
> Any additional suggestions on how to overcome this problem gratefully received.
> 
> -- 
>  
> 
> 
> 

 
------=_Part_9332_1497520887.1703184981868
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body><br>
A bit weird that a simple dd is so slow.<br>
<br>
Just a quick thought.<br>
Are your partitions aligned properly?<br>
Is other IO going on on the same time?<br>
What does gstat say about %util, queue length and all the other stats while running the dd? Or "iostat -x -d 1".<br>
<br>
Could you try if another disk has the same issues?<br>
<br>
How is your disk connected? USB-to-SATA-adapter? Any output of dmesg?<br>
<br>
Regards,<br>
Ronald.<br>
<br>
&nbsp;
<p><strong>Van:</strong> void &lt;void@f-m.fm&gt;<br>
<strong>Datum:</strong> donderdag, 21 december 2023 16:50<br>
<strong>Aan:</strong> freebsd-fs@freebsd.org<br>
<strong>Onderwerp:</strong> Re: measuring swap partition speed</p>

<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px">
<div class="MessageRFC822Viewer" id="P">
<div class="TextPlainViewer" id="P.P">On Wed, Dec 20, 2023 at 07:48:14PM -0800, Mark Millard wrote:<br>
<br>
&gt;# swapoff /dev/label/growfs_swap<br>
&gt;# dd if=/dev/urandom of=/dev/da0s2b bs=8k count=250000 conv=sync status=progress<br>
&gt;^C478830592 bytes (479 MB, 457 MiB) transferred 22.001s, 22 MB/s<br>
&gt;60557+0 records in<br>
&gt;60556+0 records out<br>
&gt;496074752 bytes transferred in 22.790754 secs (21766491 bytes/sec)<br>
<br>
22MB/s is usable, I think. In my context, I'd be satisfied with that.<br>
My context differs from yours slightly in that yours is SSD and mine<br>
is spinning rust.<br>
<br>
This is unusable:<br>
# dd if=/dev/urandom of=/dev/da0p4 bs=8k count=250000 conv=sync status=progress<br>
^C11862016 bytes (12 MB, 11 MiB) transferred 40.063s, 296 kB/s &nbsp;&nbsp;<br>
<br>
because it's way too slow. Swap never gets fully reclaimed,<br>
thrashing happens, loads of other followon effects happen.<br>
The same partition formatted as ufs reports 113 MB/s. Multiple swap partitions<br>
have been tested, then converted to ufs. Results are the same.<br>
<br>
There are no reported errors in smartctl. Long smartctl tests run monthly.<br>
<br>
5 Reallocated_Sector_Ct &nbsp;&nbsp;PO--CK &nbsp;&nbsp;100 &nbsp;&nbsp;100 &nbsp;&nbsp;050 &nbsp;&nbsp;&nbsp;- &nbsp;&nbsp;&nbsp;0<br>
9 Power_On_Hours &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-O--CK &nbsp;&nbsp;001 &nbsp;&nbsp;001 &nbsp;&nbsp;000 &nbsp;&nbsp;&nbsp;- &nbsp;&nbsp;&nbsp;48992<br>
196 Reallocated_Event_Count -O--CK &nbsp;&nbsp;100 &nbsp;&nbsp;100 &nbsp;&nbsp;000 &nbsp;&nbsp;&nbsp;- &nbsp;&nbsp;&nbsp;0<br>
197 Current_Pending_Sector &nbsp;-O--CK &nbsp;&nbsp;100 &nbsp;&nbsp;100 &nbsp;&nbsp;000 &nbsp;&nbsp;&nbsp;- &nbsp;&nbsp;&nbsp;0<br>
198 Offline_Uncorrectable &nbsp;&nbsp;----CK &nbsp;&nbsp;100 &nbsp;&nbsp;100 &nbsp;&nbsp;000 &nbsp;&nbsp;&nbsp;- &nbsp;&nbsp;&nbsp;0<br>
<br>
I can't find any hardware problem here. Possible workarounds, bearing in mind I'm not versant in C so it's not like I can fix this myself in code:<br>
<br>
1. swap as swapfile and not partition [a]<br>
2. swap as nfs [b]<br>
3. swapoff &amp; swapon script running every minute [c]<br>
4. just turn all swap off and reboot after crashing (undesirable)<br>
5. use another OS that doesn't have this problem<br>
<br>
[a] not tried yet, and i hope it works. Legacy info suggests swap as partition is usually<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;faster than filesystem-based swap. But the reverse might be the case here.<br>
<br>
[b] also not tried. This, I imagine, would be filesystem only (I'm unsure a zfs volume can<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be exported to look like a mountable partition to the client)<br>
<br>
[c] <a href="https://github.com/Freaky/swapflush.git">https://github.com/Freaky/swapflush.git</a>; - usually works but maybe i need to run it every &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;minute instead of every five mins. For testing, this script was disabled.<br>
<br>
Any additional suggestions on how to overcome this problem gratefully received.<br>
<br>
--&nbsp;<br>
&nbsp;</div>

<hr></div>
</blockquote>
<br>
&nbsp;</body></html>
------=_Part_9332_1497520887.1703184981868--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1439231787.9333.1703184981914>