Re: Hibernation takes too long

2019-07-23 Thread Rick Thomas
And here’s an example where the output media is an SD card:

rbthomas@nuc8:/media/rbthomas/99602c92-f887-4578-b6bc-39c91d49c43c/rbthomas$ dd 
if=/dev/zero of=tempfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.48058 s, 2.2 GB/s

rbthomas@nuc8:/media/rbthomas/99602c92-f887-4578-b6bc-39c91d49c43c/rbthomas$ dd 
if=/dev/zero of=tempfile bs=1M count=1024 oflag=sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 34.044 s, 31.5 MB/s



> On Jul 23, 2019, at 1:19 AM, Rick Thomas  wrote:
> 
> Here’s an example from one of my machines with a SATA-III SSD and lots of RAM:
> 
> rbthomas@nuc8:~$ dd if=/dev/zero of=tempfile bs=1M count=1024
> 1024+0 records in
> 1024+0 records out
> 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.77789 s, 604 MB/s
> 
> rbthomas@nuc8:~$ dd if=/dev/zero of=tempfile bs=1M count=1024 oflag=sync
> 1024+0 records in
> 1024+0 records out
> 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.88158 s, 220 MB/s



Re: Hibernation takes too long

2019-07-23 Thread Rick Thomas
You need to add the clause “oflag=sync” on your dd commands.  Without it the 
MB/s numbers are really just measuring how fast you can fill up the RAM cache 
(for write) or scoop up data from the RAM cache (in the case of read).

Here’s an example from one of my machines with a SATA-III SSD and lots of RAM:

rbthomas@nuc8:~$ dd if=/dev/zero of=tempfile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.77789 s, 604 MB/s

rbthomas@nuc8:~$ dd if=/dev/zero of=tempfile bs=1M count=1024 oflag=sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.88158 s, 220 MB/s

Hope it helps!
Rick

> On Jul 21, 2019, at 2:44 PM, Shahryar Afifi  wrote:
> 
> Correct!
> I attached a screen shot of read write speed.
> The 2 min hibernation time is when there is little or no contents
> present. If I have many things opened, it would take more.



Re: Hibernation takes too long

2019-07-23 Thread Michael Kesper
Hi all,

sorry for having spread half-knowledge here.

On 22.07.19 15:53, Stefan Monnier wrote:
> Also, if the problem is in the time it takes to write the hibernation
> data, then those 2 minutes should mostly be spent with a display that
> says "blabla ... NN%" where the NN slowly goes from 0 to 100.
> 
> IIUC this is not what you're seeing

This leads back to OPs question:
Where can he find some log entry showing what's going on?

Is it maybe connected to an old CPU somehow?
What would be relevant infos to collect, the output of hwinfo piped to a text 
file?

Best
Michael



signature.asc
Description: OpenPGP digital signature


Re: Hibernation takes too long

2019-07-22 Thread Stefan Monnier
> I attached a screen shot of read write speed.
> The 2 min hibernation time is when there is little or no contents
> present. If I have many things opened, it would take more.

Also, if the problem is in the time it takes to write the hibernation
data, then those 2 minutes should mostly be spent with a display that
says "blabla ... NN%" where the NN slowly goes from 0 to 100.

IIUC this is not what you're seeing


Stefan "who has an SSD which occasionally slows down to about
1MB/s write speed"



Re: Hibernation takes too long

2019-07-21 Thread Anders Andersson
On Sun, Jul 21, 2019 at 4:50 AM Michael Kesper  wrote:
> Am 21. Juli 2019 02:45:39 MESZ schrieb Shahryar Afifi 
> :
> >here is my setup:
> >X61 with Middleton's bios (SATA 2)
> >...
>
> ...
> The X61 will throttle SSD throughput as it has less bandwidth than modern 
> SATA adapters. So, transferring those 6 GB
> will take time...

OP apparently runs a modified BIOS that removes the crippled X61 SATA
and at least enables SATA II. I've considered giving my old X61 the
same treatment. I seriously doubt that the SATA II bus speed is the
bottleneck here.



Re: Hibernation takes too long

2019-07-21 Thread Stefan Monnier
> What is the proportional size between RAM and swap?

There's no such thing.
They're both sized depending on your particular needs.


Stefan



Re: Hibernation takes too long

2019-07-21 Thread Stefan Monnier
> Afaik it's advised to copy files to SSDs and not copy blockwise (dd) because
> layouts can differ very much and performance would suffer.

As long as the filesystem is properly aligned on a 4KB boundary, I don't
think there'll be any noticeable difference.  I highly doubt this
explains the 2 minutes needed to hibernate.

>>At idle, only 1.2 Gb of RAM is occupied, so not all the 12GB should be
>>moved to SSD.
>
> The 6 GB of RAM will be moved to the swap partition.

No, only the occupied part of the RAM, and not even all of it (the
parts that correspond to memory-mapped files (e.g. libraries and
executables)) won't, for example.  So we're likely taking about less
than 1GB in this 1.2GB case.

> That's why swap needs to be >= RAM for hibernating.

Actually, this is neither necessary nor sufficient:
- the RAM can't be saved into the part of the swap already used, so the
  rule should be "the unused part of the swap >= RAM" in order for the
  rule to be sufficient.
- as mentioned about, not all the RAM needs to be saved to swap, and
  furthermore, hibernation usually compresses the data before saving it
  into the swap space, so it typically needs significantly less than the
  RAM (I'd expect a compression in the order of 3x).

> The X61 will throttle SSD throughput as it has less bandwidth than modern
> SATA adapters. So, transferring those 6 GB
> will take time...

1GB/3 is about 300MB, which shouldn't take more than 10s to save.


Stefan



Re: Hibernation takes too long

2019-07-20 Thread Michael Kesper
Hi all,

Am 21. Juli 2019 02:45:39 MESZ schrieb Shahryar Afifi :
>Thank you for your insight.
>your explanation was helpful.
>here is my setup:
>X61 with Middleton's bios (SATA 2)
>buster amd64
>upgraded from strech
>cloned from 64GB to 128GB

How did you do that?
Afaik it's advised to copy files to SSDs and not copy blockwise (dd) because
layouts can differ very much and performance would suffer.

>At idle, only 1.2 Gb of RAM is occupied, so not all the 12GB should be
>moved to SSD.

The 6 GB of RAM will be moved to the swap partition. That's why swap needs to 
be >= RAM for hibernating.

The X61 will throttle SSD throughput as it has less bandwidth than modern SATA 
adapters. So, transferring those 6 GB
will take time...
You could limit memory with kernel boot parameter, e.g. mem=2G
to test, time needed should be approximately a third (but obviously 4GB of RAM 
would be wasted).

Best
Michael



Re: Hibernation takes too long

2019-07-20 Thread Carl Fink

On 7/20/19 8:16 PM, Rick Thomas wrote:

If 12GB is reasonable (I have no idea, I don’t use “hibernate” myself) here are 
figures to input to the calculation:

I was just assuming that Shahryar's hibernation
involved backing up the full contents of both
RAM and swap, which would be 12 gb.

--
Carl Fink   nitpick...@nitpicking.com

Read my blog at blog.nitpicking.com.  Reviews!  Observations!



Re: Hibernation takes too long

2019-07-20 Thread Rick Thomas
If 12GB is reasonable (I have no idea, I don’t use “hibernate” myself) here are 
figures to input to the calculation:

SSD sustained write transfer rate is between 30 MB/sec and 120 MB/sec.
Closer to 30 MB/sec (or even slower) if it’s a USB-3 thumb drive (even less 
than that if USB-2); closer to 120 MB/sec if it’s a SATA drive.

So: 12GB/30MB/sec = 6.7 minutes
12GB/120MB/sec = 1.7 minutes

So 2 minutes is not unreasonable.
Rick


> On Jul 20, 2019, at 8:14 AM, Shahryar Afifi  wrote:
> 
> If bulk storage is the same as mass storage, I have 128 SSD
> 
> On Sat, 2019-07-20 at 09:27 -0400, Carl Fink wrote:
>> On 7/20/19 12:43 AM, Shahryar Afifi wrote:
>>> Up to 2 Min
>>> 
>>> amd64
>>> buster
>>> X61
>>> 6GB dynamic
>>> 6GB swap
>>> swapness 50
>>> 
>>> I don't know which log file to loo into...
>>> 
>>> Thank you.
>>> 
>> What are you using for bulk storage? Your system
>> has to copy ~12 gigabytes into it. Do the math--is
>> that the main reason for your wait?
>> 
> 



Re: Hibernation takes too long

2019-07-20 Thread Carl Fink

On 7/20/19 12:43 AM, Shahryar Afifi wrote:

Up to 2 Min

amd64
buster
X61
6GB dynamic
6GB swap
swapness 50

I don't know which log file to loo into...

Thank you.


What are you using for bulk storage? Your system
has to copy ~12 gigabytes into it. Do the math--is
that the main reason for your wait?

--
Carl Fink   nitpick...@nitpicking.com

Read my blog at blog.nitpicking.com.  Reviews!  Observations!