Re: Configure OpenBSD for remote server rarely used

2022-11-28 Thread James Johnson
Ah, pretty cool, I'll keep it in mind for my next project ;)

On 28.11.2022 10:36, Bodie wrote:

And if you really need low consumption, rugged computer and do not mind
about the costs you can go eg. this way :-)

https://teguar.com/ip67-box-pc-twb-2945 
/


Re: Configure OpenBSD for remote server rarely used

2022-11-28 Thread Bodie




On 28.11.2022 11:18, James Johnson wrote:
Thanks a lot for all the great advice, that is very useful. It all 
makes sense.




And if you really need low consumption, rugged computer and do not mind
about the costs you can go eg. this way :-)

https://teguar.com/ip67-box-pc-twb-2945/


On 27 Nov 2022, at 21:10, Tomasz Rola  wrote:

On Sun, Nov 27, 2022 at 09:37:19AM +, James Johnson wrote:

Hi all,

OpenBSD is amazing. But I need help in configuring it correctly as a
remote server, rarely used.


The main thing I am trying to do is to make it sleep every now and
then to protect resources. I am very flexible on how to do this, but
have been unable to do so.
Here's what I tried :

[...]

So to sum up your requirements, you want a self driving box which
waits, and once every month or six wakes up, does something, then goes
idle again.

I would avoid power down/up completely - boot takes time, and fsck
takes some more time. Also, AFAIK electronics wears down every time it
goes on-off.

Modern HDD are said to live to 5 on-off cycles, so assume 2
cold boots. But random things can happen, because on-off means power
spike. If you have no problem with eletricity, I would keep it going
all the time. I would however minimise writes. Work on temporary data
in ramdisk, write results to disk. Something like this.

BIOS battery goes down faster when computer is powered down. When it
is up, clock gets power from the wall and saves the battery. I assume
the modern CMOS battery will only keep the clock for about a year
without power and it will not recharge when you power up. After that
time (and before that time, too, but less necessary), every boot
should include query to time server and adjusting the hardware clock.

I would buy a decent PSU. Last time I wanted to know, Seasonic was the
maker of best ones a mortal could buy. Their last unit I bought came
with 10 years warranty. AND, according to description, it was built
with classic electronic art, analog parts, no digital. So if you are
so inclined, you can ask your electronic buddy to inspect it and
perhaps even replace some parts with better ones. Or repair it. If
microcontroller goes bunk, you are out of luck, I assume they somehow
protect their eproms.

If you plan to store some long term data on this box, I would avoid
SSD. They are fast but they also can go bunk and when they do, chance
of recovering data is close to nil (from what I have read).

I would consider putting the box in a plastic bag to protect from dust
and humidity. Dust will clog into radiators, make chips go hotter,
ventillators work harder. I have not tested this, however. I assume
thermal exchange with loose bag over the box should go ok, but you
need to test it very carefully, monitoring temps all the time - all
temps.

HTH

--
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did "rm -rif" on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **




Re: Configure OpenBSD for remote server rarely used

2022-11-28 Thread James Johnson
Thanks a lot for all the great advice, that is very useful. It all makes sense.

> On 27 Nov 2022, at 21:10, Tomasz Rola  wrote:
> 
> On Sun, Nov 27, 2022 at 09:37:19AM +, James Johnson wrote:
>> Hi all,
>> 
>> OpenBSD is amazing. But I need help in configuring it correctly as a
>> remote server, rarely used. 
>> 
>> 
>> The main thing I am trying to do is to make it sleep every now and
>> then to protect resources. I am very flexible on how to do this, but
>> have been unable to do so.
>> Here's what I tried :
> [...]
> 
> So to sum up your requirements, you want a self driving box which
> waits, and once every month or six wakes up, does something, then goes
> idle again.
> 
> I would avoid power down/up completely - boot takes time, and fsck
> takes some more time. Also, AFAIK electronics wears down every time it
> goes on-off.
> 
> Modern HDD are said to live to 5 on-off cycles, so assume 2
> cold boots. But random things can happen, because on-off means power
> spike. If you have no problem with eletricity, I would keep it going
> all the time. I would however minimise writes. Work on temporary data
> in ramdisk, write results to disk. Something like this.
> 
> BIOS battery goes down faster when computer is powered down. When it
> is up, clock gets power from the wall and saves the battery. I assume
> the modern CMOS battery will only keep the clock for about a year
> without power and it will not recharge when you power up. After that
> time (and before that time, too, but less necessary), every boot
> should include query to time server and adjusting the hardware clock.
> 
> I would buy a decent PSU. Last time I wanted to know, Seasonic was the
> maker of best ones a mortal could buy. Their last unit I bought came
> with 10 years warranty. AND, according to description, it was built
> with classic electronic art, analog parts, no digital. So if you are
> so inclined, you can ask your electronic buddy to inspect it and
> perhaps even replace some parts with better ones. Or repair it. If
> microcontroller goes bunk, you are out of luck, I assume they somehow
> protect their eproms.
> 
> If you plan to store some long term data on this box, I would avoid
> SSD. They are fast but they also can go bunk and when they do, chance
> of recovering data is close to nil (from what I have read).
> 
> I would consider putting the box in a plastic bag to protect from dust
> and humidity. Dust will clog into radiators, make chips go hotter,
> ventillators work harder. I have not tested this, however. I assume
> thermal exchange with loose bag over the box should go ok, but you
> need to test it very carefully, monitoring temps all the time - all
> temps.
> 
> HTH
> 
> -- 
> Regards,
> Tomasz Rola
> 
> --
> ** A C programmer asked whether computer had Buddha's nature.  **
> ** As the answer, master did "rm -rif" on the programmer's home**
> ** directory. And then the C programmer became enlightened...  **
> ** **
> ** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **



Re: Configure OpenBSD for remote server rarely used

2022-11-28 Thread Greg Thomas
You should reboot whenever patches or upgrades require it.  Was that a
trick question or something?

On Mon, Nov 28, 2022 at 12:51 AM Greg Thomas 
wrote:

>
>
> On Sun, Nov 27, 2022 at 12:08 PM James Johnson 
> wrote:
>
>> Thank you for this interesting perspective.
>>
>> Combined with the previous advice, I am convinced. I will not try to have
>> the machine sleep, or even try to put the drives in spun down. From what
>> you guys are saying, it seems doing so would be over-engineering.
>>
>> What are your thoughts regarding reboots? Should I do a daily, weekly,
>> monthly reboot?
>>
>>
>> > On 27 Nov 2022, at 20:00, Bodie  wrote:
>> >
>> >
>> >
>> > On 27.11.2022 10:37, James Johnson wrote:
>> >> Hi all,
>> >> OpenBSD is amazing. But I need help in configuring it correctly as a
>> >> remote server, rarely used.
>> >> The main thing I am trying to do is to make it sleep every now and
>> >> then to protect resources. I am very flexible on how to do this, but
>> >> have been unable to do so.
>> >> Here's what I tried :
>> >> 1) Make it sleep and wake up when woken up remotely
>> >> I investigated Wake On Lan, which I enabled via ifconfig. However,
>> >> this system is deployed remotely, and I have no access to other
>> >> computers on the LAN, so I am unable to make this work.
>> >> 2) Make it sleep for a few hours and then wake up
>> >> After 3hours+ of research in man pages and the internet, I have not
>> >> seen any solution for that.
>> >> 3) hard drives Spin down, CPU lower freq
>> >> I have been able to lower the CPU speed by running `apm -L`.
>> >> I haven't been able to spin down the hard drives.
>> >> How important is it to manually send a command to spin down the unused
>> >> harddrives? Will it be down by the system automatically?
>> >> I am trying to get info on the drives from the system but `atactl sd0
>> >> checkpower ` always shows `standby` even after I have just written on
>> >> the disk. I understand this does not work because my drives are SCSI
>> >> and not ATA.
>> >> I read the man page for scsi, and I see the command to spin down hard
>> >> drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
>> >> However, I see no command to spin them back up. Is it automatic?
>> >> How can I request information on the spin state of the drive. I am
>> >> just a little worried about starting to send low levels instructions
>> >> to the hard drive, with little understanding of it. Is it safe to send
>> >> this command?
>> >> Thanks all !
>> >> PS : dmesg : I cannot share the full dmesg for security reasons, but
>> >> it is a fairly standard i386 machine, with 2 drives mounted as SCSI.
>> >
>> > As already pointed out by others. Don't do that ;-) Unless you explain
>> > why you need to do that (I'm sure it is possible without disclosing
>> much)
>> >
>> > I build systems running for eg. 12 years, amd64 architecture, SATA
>> disks,
>> > DDR RAM and so on. Serving number of virtual machines with constantly
>> > higher number of utilizations and in dozens of them only 2 problems
>> > during those years - battery for internal RAID run out :-)
>> >
>> > Saw systems which were running for over 30 years and nothing wrong with
>> > them.
>> >
>> > Can't talk about electricity as those are basically underground cities
>> > and there are different problems then if CPU is running 3 or 1GHz ;-)
>> >
>> > Sounds like maybe some IoT solution, but then go for ARM or use virtual
>> > machine in eg. OpenBSD Amsterdam or you really need compute power on
>> > demand then go for free options in eg. Azure (12 months free basic
>> Linux)
>> > or Oracle Cloud Infrastructure or whatever else you find fit.
>> >
>> > Either it is so important, need to be physically under your control and
>> > then small differences in electricity does not matter or solutions above
>> > are perfectly fine for your needs.
>> >
>> > Just one hint. No matter if own machine or something rented you want
>> that
>> > machine to be worth the money that means to do something on it and not
>> > have it shut down ;-)
>>
>>


Re: Configure OpenBSD for remote server rarely used

2022-11-28 Thread Greg Thomas
On Sun, Nov 27, 2022 at 12:08 PM James Johnson 
wrote:

> Thank you for this interesting perspective.
>
> Combined with the previous advice, I am convinced. I will not try to have
> the machine sleep, or even try to put the drives in spun down. From what
> you guys are saying, it seems doing so would be over-engineering.
>
> What are your thoughts regarding reboots? Should I do a daily, weekly,
> monthly reboot?
>
>
> > On 27 Nov 2022, at 20:00, Bodie  wrote:
> >
> >
> >
> > On 27.11.2022 10:37, James Johnson wrote:
> >> Hi all,
> >> OpenBSD is amazing. But I need help in configuring it correctly as a
> >> remote server, rarely used.
> >> The main thing I am trying to do is to make it sleep every now and
> >> then to protect resources. I am very flexible on how to do this, but
> >> have been unable to do so.
> >> Here's what I tried :
> >> 1) Make it sleep and wake up when woken up remotely
> >> I investigated Wake On Lan, which I enabled via ifconfig. However,
> >> this system is deployed remotely, and I have no access to other
> >> computers on the LAN, so I am unable to make this work.
> >> 2) Make it sleep for a few hours and then wake up
> >> After 3hours+ of research in man pages and the internet, I have not
> >> seen any solution for that.
> >> 3) hard drives Spin down, CPU lower freq
> >> I have been able to lower the CPU speed by running `apm -L`.
> >> I haven't been able to spin down the hard drives.
> >> How important is it to manually send a command to spin down the unused
> >> harddrives? Will it be down by the system automatically?
> >> I am trying to get info on the drives from the system but `atactl sd0
> >> checkpower ` always shows `standby` even after I have just written on
> >> the disk. I understand this does not work because my drives are SCSI
> >> and not ATA.
> >> I read the man page for scsi, and I see the command to spin down hard
> >> drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
> >> However, I see no command to spin them back up. Is it automatic?
> >> How can I request information on the spin state of the drive. I am
> >> just a little worried about starting to send low levels instructions
> >> to the hard drive, with little understanding of it. Is it safe to send
> >> this command?
> >> Thanks all !
> >> PS : dmesg : I cannot share the full dmesg for security reasons, but
> >> it is a fairly standard i386 machine, with 2 drives mounted as SCSI.
> >
> > As already pointed out by others. Don't do that ;-) Unless you explain
> > why you need to do that (I'm sure it is possible without disclosing much)
> >
> > I build systems running for eg. 12 years, amd64 architecture, SATA disks,
> > DDR RAM and so on. Serving number of virtual machines with constantly
> > higher number of utilizations and in dozens of them only 2 problems
> > during those years - battery for internal RAID run out :-)
> >
> > Saw systems which were running for over 30 years and nothing wrong with
> > them.
> >
> > Can't talk about electricity as those are basically underground cities
> > and there are different problems then if CPU is running 3 or 1GHz ;-)
> >
> > Sounds like maybe some IoT solution, but then go for ARM or use virtual
> > machine in eg. OpenBSD Amsterdam or you really need compute power on
> > demand then go for free options in eg. Azure (12 months free basic Linux)
> > or Oracle Cloud Infrastructure or whatever else you find fit.
> >
> > Either it is so important, need to be physically under your control and
> > then small differences in electricity does not matter or solutions above
> > are perfectly fine for your needs.
> >
> > Just one hint. No matter if own machine or something rented you want that
> > machine to be worth the money that means to do something on it and not
> > have it shut down ;-)
>
>


Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Bodie




On 27.11.2022 21:07, James Johnson wrote:

Thank you for this interesting perspective.

Combined with the previous advice, I am convinced. I will not try to
have the machine sleep, or even try to put the drives in spun down.
From what you guys are saying, it seems doing so would be
over-engineering.

What are your thoughts regarding reboots? Should I do a daily, weekly,
monthly reboot?



Now even more curious what it is running. If that would be something
mission critical you would not be asking these questions.

Which means you're learning along the way.

If it's not some environment monitor which needs to be physical locally
then for just running scripts you may be better served by free Docker
instance avoiding handling of physical computer (true getting different
source of possible problems, but smaller ones :-))




On 27 Nov 2022, at 20:00, Bodie  wrote:



On 27.11.2022 10:37, James Johnson wrote:

Hi all,
OpenBSD is amazing. But I need help in configuring it correctly as a
remote server, rarely used.
The main thing I am trying to do is to make it sleep every now and
then to protect resources. I am very flexible on how to do this, but
have been unable to do so.
Here's what I tried :
1) Make it sleep and wake up when woken up remotely
I investigated Wake On Lan, which I enabled via ifconfig. However,
this system is deployed remotely, and I have no access to other
computers on the LAN, so I am unable to make this work.
2) Make it sleep for a few hours and then wake up
After 3hours+ of research in man pages and the internet, I have not
seen any solution for that.
3) hard drives Spin down, CPU lower freq
I have been able to lower the CPU speed by running `apm -L`.
I haven't been able to spin down the hard drives.
How important is it to manually send a command to spin down the 
unused

harddrives? Will it be down by the system automatically?
I am trying to get info on the drives from the system but `atactl sd0
checkpower ` always shows `standby` even after I have just written on
the disk. I understand this does not work because my drives are SCSI
and not ATA.
I read the man page for scsi, and I see the command to spin down hard
drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
However, I see no command to spin them back up. Is it automatic?
How can I request information on the spin state of the drive. I am
just a little worried about starting to send low levels instructions
to the hard drive, with little understanding of it. Is it safe to 
send

this command?
Thanks all !
PS : dmesg : I cannot share the full dmesg for security reasons, but
it is a fairly standard i386 machine, with 2 drives mounted as SCSI.


As already pointed out by others. Don't do that ;-) Unless you explain
why you need to do that (I'm sure it is possible without disclosing 
much)


I build systems running for eg. 12 years, amd64 architecture, SATA 
disks,

DDR RAM and so on. Serving number of virtual machines with constantly
higher number of utilizations and in dozens of them only 2 problems
during those years - battery for internal RAID run out :-)

Saw systems which were running for over 30 years and nothing wrong 
with

them.

Can't talk about electricity as those are basically underground cities
and there are different problems then if CPU is running 3 or 1GHz ;-)

Sounds like maybe some IoT solution, but then go for ARM or use 
virtual

machine in eg. OpenBSD Amsterdam or you really need compute power on
demand then go for free options in eg. Azure (12 months free basic 
Linux)

or Oracle Cloud Infrastructure or whatever else you find fit.

Either it is so important, need to be physically under your control 
and
then small differences in electricity does not matter or solutions 
above

are perfectly fine for your needs.

Just one hint. No matter if own machine or something rented you want 
that

machine to be worth the money that means to do something on it and not
have it shut down ;-)




Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Tomasz Rola
On Sun, Nov 27, 2022 at 09:37:19AM +, James Johnson wrote:
> Hi all,
> 
> OpenBSD is amazing. But I need help in configuring it correctly as a
> remote server, rarely used. 
> 
> 
> The main thing I am trying to do is to make it sleep every now and
> then to protect resources. I am very flexible on how to do this, but
> have been unable to do so.
> Here's what I tried :
[...]

So to sum up your requirements, you want a self driving box which
waits, and once every month or six wakes up, does something, then goes
idle again.

I would avoid power down/up completely - boot takes time, and fsck
takes some more time. Also, AFAIK electronics wears down every time it
goes on-off.

Modern HDD are said to live to 5 on-off cycles, so assume 2
cold boots. But random things can happen, because on-off means power
spike. If you have no problem with eletricity, I would keep it going
all the time. I would however minimise writes. Work on temporary data
in ramdisk, write results to disk. Something like this.

BIOS battery goes down faster when computer is powered down. When it
is up, clock gets power from the wall and saves the battery. I assume
the modern CMOS battery will only keep the clock for about a year
without power and it will not recharge when you power up. After that
time (and before that time, too, but less necessary), every boot
should include query to time server and adjusting the hardware clock.

I would buy a decent PSU. Last time I wanted to know, Seasonic was the
maker of best ones a mortal could buy. Their last unit I bought came
with 10 years warranty. AND, according to description, it was built
with classic electronic art, analog parts, no digital. So if you are
so inclined, you can ask your electronic buddy to inspect it and
perhaps even replace some parts with better ones. Or repair it. If
microcontroller goes bunk, you are out of luck, I assume they somehow
protect their eproms.

If you plan to store some long term data on this box, I would avoid
SSD. They are fast but they also can go bunk and when they do, chance
of recovering data is close to nil (from what I have read).

I would consider putting the box in a plastic bag to protect from dust
and humidity. Dust will clog into radiators, make chips go hotter,
ventillators work harder. I have not tested this, however. I assume
thermal exchange with loose bag over the box should go ok, but you
need to test it very carefully, monitoring temps all the time - all
temps.

HTH

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did "rm -rif" on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread James Johnson
Thank you for this interesting perspective. 

Combined with the previous advice, I am convinced. I will not try to have the 
machine sleep, or even try to put the drives in spun down. From what you guys 
are saying, it seems doing so would be over-engineering.

What are your thoughts regarding reboots? Should I do a daily, weekly, monthly 
reboot?


> On 27 Nov 2022, at 20:00, Bodie  wrote:
> 
> 
> 
> On 27.11.2022 10:37, James Johnson wrote:
>> Hi all,
>> OpenBSD is amazing. But I need help in configuring it correctly as a
>> remote server, rarely used.
>> The main thing I am trying to do is to make it sleep every now and
>> then to protect resources. I am very flexible on how to do this, but
>> have been unable to do so.
>> Here's what I tried :
>> 1) Make it sleep and wake up when woken up remotely
>> I investigated Wake On Lan, which I enabled via ifconfig. However,
>> this system is deployed remotely, and I have no access to other
>> computers on the LAN, so I am unable to make this work.
>> 2) Make it sleep for a few hours and then wake up
>> After 3hours+ of research in man pages and the internet, I have not
>> seen any solution for that.
>> 3) hard drives Spin down, CPU lower freq
>> I have been able to lower the CPU speed by running `apm -L`.
>> I haven't been able to spin down the hard drives.
>> How important is it to manually send a command to spin down the unused
>> harddrives? Will it be down by the system automatically?
>> I am trying to get info on the drives from the system but `atactl sd0
>> checkpower ` always shows `standby` even after I have just written on
>> the disk. I understand this does not work because my drives are SCSI
>> and not ATA.
>> I read the man page for scsi, and I see the command to spin down hard
>> drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
>> However, I see no command to spin them back up. Is it automatic?
>> How can I request information on the spin state of the drive. I am
>> just a little worried about starting to send low levels instructions
>> to the hard drive, with little understanding of it. Is it safe to send
>> this command?
>> Thanks all !
>> PS : dmesg : I cannot share the full dmesg for security reasons, but
>> it is a fairly standard i386 machine, with 2 drives mounted as SCSI.
> 
> As already pointed out by others. Don't do that ;-) Unless you explain
> why you need to do that (I'm sure it is possible without disclosing much)
> 
> I build systems running for eg. 12 years, amd64 architecture, SATA disks,
> DDR RAM and so on. Serving number of virtual machines with constantly
> higher number of utilizations and in dozens of them only 2 problems
> during those years - battery for internal RAID run out :-)
> 
> Saw systems which were running for over 30 years and nothing wrong with
> them.
> 
> Can't talk about electricity as those are basically underground cities
> and there are different problems then if CPU is running 3 or 1GHz ;-)
> 
> Sounds like maybe some IoT solution, but then go for ARM or use virtual
> machine in eg. OpenBSD Amsterdam or you really need compute power on
> demand then go for free options in eg. Azure (12 months free basic Linux)
> or Oracle Cloud Infrastructure or whatever else you find fit.
> 
> Either it is so important, need to be physically under your control and
> then small differences in electricity does not matter or solutions above
> are perfectly fine for your needs.
> 
> Just one hint. No matter if own machine or something rented you want that
> machine to be worth the money that means to do something on it and not
> have it shut down ;-)



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Bodie




On 27.11.2022 10:37, James Johnson wrote:

Hi all,

OpenBSD is amazing. But I need help in configuring it correctly as a
remote server, rarely used.


The main thing I am trying to do is to make it sleep every now and
then to protect resources. I am very flexible on how to do this, but
have been unable to do so.
Here's what I tried :

1) Make it sleep and wake up when woken up remotely
I investigated Wake On Lan, which I enabled via ifconfig. However,
this system is deployed remotely, and I have no access to other
computers on the LAN, so I am unable to make this work.

2) Make it sleep for a few hours and then wake up
After 3hours+ of research in man pages and the internet, I have not
seen any solution for that.

3) hard drives Spin down, CPU lower freq

I have been able to lower the CPU speed by running `apm -L`.
I haven't been able to spin down the hard drives.
How important is it to manually send a command to spin down the unused
harddrives? Will it be down by the system automatically?

I am trying to get info on the drives from the system but `atactl sd0
checkpower ` always shows `standby` even after I have just written on
the disk. I understand this does not work because my drives are SCSI
and not ATA.
I read the man page for scsi, and I see the command to spin down hard
drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
However, I see no command to spin them back up. Is it automatic?
How can I request information on the spin state of the drive. I am
just a little worried about starting to send low levels instructions
to the hard drive, with little understanding of it. Is it safe to send
this command?

Thanks all !


PS : dmesg : I cannot share the full dmesg for security reasons, but
it is a fairly standard i386 machine, with 2 drives mounted as SCSI.


As already pointed out by others. Don't do that ;-) Unless you explain
why you need to do that (I'm sure it is possible without disclosing 
much)


I build systems running for eg. 12 years, amd64 architecture, SATA 
disks,

DDR RAM and so on. Serving number of virtual machines with constantly
higher number of utilizations and in dozens of them only 2 problems
during those years - battery for internal RAID run out :-)

Saw systems which were running for over 30 years and nothing wrong with
them.

Can't talk about electricity as those are basically underground cities
and there are different problems then if CPU is running 3 or 1GHz ;-)

Sounds like maybe some IoT solution, but then go for ARM or use virtual
machine in eg. OpenBSD Amsterdam or you really need compute power on
demand then go for free options in eg. Azure (12 months free basic 
Linux)

or Oracle Cloud Infrastructure or whatever else you find fit.

Either it is so important, need to be physically under your control and
then small differences in electricity does not matter or solutions above
are perfectly fine for your needs.

Just one hint. No matter if own machine or something rented you want 
that

machine to be worth the money that means to do something on it and not
have it shut down ;-)



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread James Johnson
"Does it just need to wake up to run a script and then shut down again" -> yes, 
that's basically that. Of course, requirements might evolve.
"Why does it even have to be a separate machine?" -> There are benefits to 
this, including data safety (different location).

Thank you for your help, have a great day.



> On 27 Nov 2022, at 18:09, Jan Stary  wrote:
> 
>>> As for rotating metal disks, they have a lifetime;
>>> that's why replacing them with SSD might be your best bet.
>> 
>> In the case of an SDD, is there no consideration of turning them off,
>> if they are unused for some time?
> 
> No.
> 
>> In the case of HDD, are you saying that putting them in "spun down"
>> mode actually would not increase their lifetime?
> 
> It might, at least they recognize (in smarttools)
> the number of hours spent rorating.
> 
> But as I said, I don;t thnik it's even worth it.
> 
>>> Wait, so you know in advance for how many _months_
>>> the machine can sleep?
>> 
>> Yes...
> 
> So how often is the machine up (per year) and for how long?
> Does it just need to wake up to run a script and then shut down again?
> (Why does it even have to be a separate machine?)
> 



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Stuart Henderson
On 2022-11-27, Jan Stary  wrote:
> that's why replacing them with SSD might be your best bet.

HDD is likely better for medium-term storage (especially if the device would
be powered down).

https://www.quora.com/How-long-can-SSD-store-data-without-power-Can-data-be-recovered-from-SSD

>> Yes, I do know in advance when the machine needs to run and when it can 
>> sleep.
>
> Then you can set a wakeup alarm in the BIOS (if it has one),
> and simply shutdown -p via cron, at the appropriate time.

Or get a remote power controller, set the machine to autostart on rexovery
after power loss, and shut the whole thing down until you need it.




Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Luke A. Call
On 2022-11-27 12:33:18-0500, Nick Holland  wrote:
> Steady-state is easiest on hw.  Powering up and down is large power
> surges, and that's generally not good.  This is across the board --
> power supply, hard drives, main board, CPU, memory, etc.  The only
> part that I think gets a benefit from being turned off would be a CRT
> monitor, and maybe the HV in an older LCD monitor.

Some Corroboration of that:  a Ph.D. physicist at a major semiconductor
manufacturer told me that power cycles cause more wear damage to memory 
chips (at least) than heat does (assuming somewhat normal use I 
imagine).

--
Luke Call
lukecall.net



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Jan Stary
> > As for rotating metal disks, they have a lifetime;
> > that's why replacing them with SSD might be your best bet.
> 
> In the case of an SDD, is there no consideration of turning them off,
> if they are unused for some time?

No.

> In the case of HDD, are you saying that putting them in "spun down"
> mode actually would not increase their lifetime?

It might, at least they recognize (in smarttools)
the number of hours spent rorating.

But as I said, I don;t thnik it's even worth it.

> > Wait, so you know in advance for how many _months_
> > the machine can sleep?
> 
> Yes...

So how often is the machine up (per year) and for how long?
Does it just need to wake up to run a script and then shut down again?
(Why does it even have to be a separate machine?)



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread James Johnson



> On 27 Nov 2022, at 17:28, Jan Stary  wrote:
> 
> On Nov 27 17:10:11, mytraddr...@gmail.com wrote:
>> I am not intending to switch the machine.
> 
> Why?

It is just not an option for this specific project.

> 
>> In terms of resources, I am mainly concerned about hard drives
>> and cpu being worn down unnecessarily. I am not sure how much
>> of a concern this should be though.
> 
> The CPU is not being "worn down" by running.
> 
> As for rotating metal disks, they have a lifetime;
> that's why replacing them with SSD might be your best bet.

In the case of an SDD, is there no consideration of turning them off, if they 
are unused for some time?
In the case of HDD, are you saying that putting them in "spun down" mode 
actually would not increase their lifetime?

> 
> But even regular disks are dirt cheap now.
> I don't believe this concern is even worth the time spent on this.
> 
>> Yes, I do know in advance when the machine needs to run and when it can 
>> sleep.
> 
> Then you can set a wakeup alarm in the BIOS (if it has one),
> and simply shutdown -p via cron, at the appropriate time.

Ok, thanks for that. I will explore whether the bios has a wake alarm

> 
>> "How much resources would that save?" -> My thoughts was that
>> it would be better for hard drive longevity to have them spun down,
>> rather than them being up for months without any access needed.
> 
> Wait, so you know in advance for how many _months_
> the machine can sleep?

Yes...

> 
> 
>> 
>>> On 27 Nov 2022, at 15:50, Jan Stary  wrote:
>>> 
>>> On Nov 27 09:37:19, mytraddr...@gmail.com wrote:
 The main thing I am trying to do is to make it sleep
 every now and then to protect resources.
>>> 
>>> How much eletricity does the machine eat?
>>> (What other "resources" are you concerned about?)
>>> 
 1) Make it sleep and wake up when woken up remotely
 I investigated Wake On Lan, which I enabled via ifconfig. However, this 
 system is deployed remotely, and I have no access to other computers on 
 the LAN, so I am unable to make this work.
 
 2) Make it sleep for a few hours and then wake up
>>> 
>>> Do you know in advance at what hours the machine
>>> needs to run, and when it can sleep?
>>> 
 After 3hours+ of research in man pages and the internet,
 I have not seen any solution for that.
>>> 
>>> Some machines have a wake option in their BIOS.
>>> 
 3) hard drives Spin down, CPU lower freq
 I have been able to lower the CPU speed by running `apm -L`.
>>> 
>>> How much electricity have you saved by that?
>>> 
 I haven't been able to spin down the hard drives.
>>> 
>>> How much resources would that save?
>>> 
>>> I you are concerned about resources, wouldn't you be better off
>>> getting a low-power machine, with SSD disks?  There are machines
>>> out there that eat around 10W and get the job done (dependeing
>>> on the job of course); and SSD doesn't need to spin down.
>>> 
 I cannot share the full dmesg for security reasons
>>> 
>>> Bullshit.
>>> 
>> 
>> 



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Nick Holland

On 11/27/22 12:10, James Johnson wrote:

Thanks for your response.

I am not intending to switch the machine. In terms of resources, I am
mainly concerned about hard drives and cpu being worn down
unnecessarily. I am not sure how much of a concern this should be
though.


The CPU isn't going to "wear out" due to being running, at least not in
a meaningful time scale.

HISTORICAL EVIDENCE hints that a spinning drive will last longer than
a frequently power cycled drive.

Steady-state is easiest on hw.  Powering up and down is large power
surges, and that's generally not good.  This is across the board --
power supply, hard drives, main board, CPU, memory, etc.  The only
part that I think gets a benefit from being turned off would be a CRT
monitor, and maybe the HV in an older LCD monitor.

That's based on historical experience with a lot of different machines.
How that relates to the hardware you have at hand, there's no way to
know, other than get 50 identical machines, power one half on-and-off
regularly and leave the other half on.


Yes, I do know in advance when the machine needs to run and when it
can sleep.

"Some machines have a wake option in their BIOS." -> thanks for the
pointer, I will look into that.


That might work for you, but I think your premise is flawed.
 

"How much electricity have you saved by that?" -> I don't know. The
main concern is not using the hardware unnecessarily, to hopefully
increase its lifetime. Though less electricity usage is a nice side
bonus.


I just did some measurements here before seeing these replies.  Short
version: single 4TB 3.5" 5400 RPM drive draws less than 7W when
running...and I doubt you get all that power "back" when you spin
down the drive.  CPUs mostly draw power when doing something, the
difference between an mostly idle CPU running at 1GHz vs. 3GHz is
fairly small.  And on a rack mount server, fans may draw more power
than an idle CPU.


"How much resources would that save?" -> My thoughts was that it
would be better for hard drive longevity to have them spun down,
rather than them being up for months without any access needed. I
don't know in practice if that matters for life expectancy of the
drive?


As someone who has seen a lot of hard drives power down working and
not spin back up at next power-on...I'm pretty sure your plan is
absolutely defeating your goal.  I'm pretty sure a whole lot of
other people are also screaming "NO!!!" at their computer right now.
I hold a lot of unpopular views based on my experience, but I'm pretty
sure "leave drives running for maximum life" is NOT one of them,
it's pretty mainstream.

From your elaboration on your goals, just leave it alone.  By trying
to make it a super-efficient system, you are going to increase your
downtime and failure in a number of ways.

Nick.







On 27 Nov 2022, at 15:50, Jan Stary  wrote:

On Nov 27 09:37:19, mytraddr...@gmail.com wrote:

The main thing I am trying to do is to make it sleep every now
and then to protect resources.


How much eletricity does the machine eat? (What other "resources"
are you concerned about?)


1) Make it sleep and wake up when woken up remotely I
investigated Wake On Lan, which I enabled via ifconfig. However,
this system is deployed remotely, and I have no access to other
computers on the LAN, so I am unable to make this work.

2) Make it sleep for a few hours and then wake up


Do you know in advance at what hours the machine needs to run, and
when it can sleep?


After 3hours+ of research in man pages and the internet, I have
not seen any solution for that.


Some machines have a wake option in their BIOS.


3) hard drives Spin down, CPU lower freq I have been able to
lower the CPU speed by running `apm -L`.


How much electricity have you saved by that?


I haven't been able to spin down the hard drives.


How much resources would that save?

I you are concerned about resources, wouldn't you be better off 
getting a low-power machine, with SSD disks?  There are machines 
out there that eat around 10W and get the job done (dependeing on

the job of course); and SSD doesn't need to spin down.


I cannot share the full dmesg for security reasons


Bullshit.







Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Jan Stary
On Nov 27 17:10:11, mytraddr...@gmail.com wrote:
> I am not intending to switch the machine.

Why?

> In terms of resources, I am mainly concerned about hard drives
> and cpu being worn down unnecessarily. I am not sure how much
> of a concern this should be though.

The CPU is not being "worn down" by running.

As for rotating metal disks, they have a lifetime;
that's why replacing them with SSD might be your best bet.

But even regular disks are dirt cheap now.
I don't believe this concern is even worth the time spent on this.

> Yes, I do know in advance when the machine needs to run and when it can sleep.

Then you can set a wakeup alarm in the BIOS (if it has one),
and simply shutdown -p via cron, at the appropriate time.

> "How much resources would that save?" -> My thoughts was that
> it would be better for hard drive longevity to have them spun down,
> rather than them being up for months without any access needed.

Wait, so you know in advance for how many _months_
the machine can sleep?


> 
> > On 27 Nov 2022, at 15:50, Jan Stary  wrote:
> > 
> > On Nov 27 09:37:19, mytraddr...@gmail.com wrote:
> >> The main thing I am trying to do is to make it sleep
> >> every now and then to protect resources.
> > 
> > How much eletricity does the machine eat?
> > (What other "resources" are you concerned about?)
> > 
> >> 1) Make it sleep and wake up when woken up remotely
> >> I investigated Wake On Lan, which I enabled via ifconfig. However, this 
> >> system is deployed remotely, and I have no access to other computers on 
> >> the LAN, so I am unable to make this work.
> >> 
> >> 2) Make it sleep for a few hours and then wake up
> > 
> > Do you know in advance at what hours the machine
> > needs to run, and when it can sleep?
> > 
> >> After 3hours+ of research in man pages and the internet,
> >> I have not seen any solution for that.
> > 
> > Some machines have a wake option in their BIOS.
> > 
> >> 3) hard drives Spin down, CPU lower freq
> >> I have been able to lower the CPU speed by running `apm -L`.
> > 
> > How much electricity have you saved by that?
> > 
> >> I haven't been able to spin down the hard drives.
> > 
> > How much resources would that save?
> > 
> > I you are concerned about resources, wouldn't you be better off
> > getting a low-power machine, with SSD disks?  There are machines
> > out there that eat around 10W and get the job done (dependeing
> > on the job of course); and SSD doesn't need to spin down.
> > 
> >> I cannot share the full dmesg for security reasons
> > 
> > Bullshit.
> > 
> 
> 



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread James Johnson
Thank you for the pointer, I will look into that.

> On 27 Nov 2022, at 14:13, T K  wrote:
> 
> "I have been able to lower the CPU speed by running `apm -L`."
> For automation purposes consider using obsdfreqd (pkg_add obsdfreqd) instead.
> 
> niedz., 27 lis 2022, 10:39 użytkownik James Johnson  > napisał:
> Hi all,
> 
> OpenBSD is amazing. But I need help in configuring it correctly as a remote 
> server, rarely used.
> 
> 
> The main thing I am trying to do is to make it sleep every now and then to 
> protect resources. I am very flexible on how to do this, but have been unable 
> to do so.
> Here's what I tried :
> 
> 1) Make it sleep and wake up when woken up remotely
> I investigated Wake On Lan, which I enabled via ifconfig. However, this 
> system is deployed remotely, and I have no access to other computers on the 
> LAN, so I am unable to make this work.
> 
> 2) Make it sleep for a few hours and then wake up
> After 3hours+ of research in man pages and the internet, I have not seen any 
> solution for that.
> 
> 3) hard drives Spin down, CPU lower freq
> 
> I have been able to lower the CPU speed by running `apm -L`.
> I haven't been able to spin down the hard drives.
> How important is it to manually send a command to spin down the unused 
> harddrives? Will it be down by the system automatically?
> 
> I am trying to get info on the drives from the system but `atactl sd0 
> checkpower ` always shows `standby` even after I have just written on the 
> disk. I understand this does not work because my drives are SCSI and not ATA.
> I read the man page for scsi, and I see the command to spin down hard drives 
> : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
> However, I see no command to spin them back up. Is it automatic?
> How can I request information on the spin state of the drive. I am just a 
> little worried about starting to send low levels instructions to the hard 
> drive, with little understanding of it. Is it safe to send this command?
> 
> Thanks all !
> 
> 
> PS : dmesg : I cannot share the full dmesg for security reasons, but it is a 
> fairly standard i386 machine, with 2 drives mounted as SCSI.
> 
> 
> 



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread James Johnson
Thanks for your response.

I am not intending to switch the machine. In terms of resources, I am mainly 
concerned about hard drives and cpu being worn down unnecessarily. I am not 
sure how much of a concern this should be though.

Yes, I do know in advance when the machine needs to run and when it can sleep.

"Some machines have a wake option in their BIOS." -> thanks for the pointer, I 
will look into that.

"How much electricity have you saved by that?" -> I don't know. The main 
concern is not using the hardware unnecessarily, to hopefully increase its 
lifetime. Though less electricity usage is a nice side bonus.

"How much resources would that save?" -> My thoughts was that it would be 
better for hard drive longevity to have them spun down, rather than them being 
up for months without any access needed. I don't know in practice if that 
matters for life expectancy of the drive?






> On 27 Nov 2022, at 15:50, Jan Stary  wrote:
> 
> On Nov 27 09:37:19, mytraddr...@gmail.com wrote:
>> The main thing I am trying to do is to make it sleep
>> every now and then to protect resources.
> 
> How much eletricity does the machine eat?
> (What other "resources" are you concerned about?)
> 
>> 1) Make it sleep and wake up when woken up remotely
>> I investigated Wake On Lan, which I enabled via ifconfig. However, this 
>> system is deployed remotely, and I have no access to other computers on the 
>> LAN, so I am unable to make this work.
>> 
>> 2) Make it sleep for a few hours and then wake up
> 
> Do you know in advance at what hours the machine
> needs to run, and when it can sleep?
> 
>> After 3hours+ of research in man pages and the internet,
>> I have not seen any solution for that.
> 
> Some machines have a wake option in their BIOS.
> 
>> 3) hard drives Spin down, CPU lower freq
>> I have been able to lower the CPU speed by running `apm -L`.
> 
> How much electricity have you saved by that?
> 
>> I haven't been able to spin down the hard drives.
> 
> How much resources would that save?
> 
> I you are concerned about resources, wouldn't you be better off
> getting a low-power machine, with SSD disks?  There are machines
> out there that eat around 10W and get the job done (dependeing
> on the job of course); and SSD doesn't need to spin down.
> 
>> I cannot share the full dmesg for security reasons
> 
> Bullshit.
> 



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread Jan Stary
On Nov 27 09:37:19, mytraddr...@gmail.com wrote:
> The main thing I am trying to do is to make it sleep
> every now and then to protect resources.

How much eletricity does the machine eat?
(What other "resources" are you concerned about?)

> 1) Make it sleep and wake up when woken up remotely
> I investigated Wake On Lan, which I enabled via ifconfig. However, this 
> system is deployed remotely, and I have no access to other computers on the 
> LAN, so I am unable to make this work.
> 
> 2) Make it sleep for a few hours and then wake up

Do you know in advance at what hours the machine
needs to run, and when it can sleep?

> After 3hours+ of research in man pages and the internet,
> I have not seen any solution for that.

Some machines have a wake option in their BIOS.

> 3) hard drives Spin down, CPU lower freq
> I have been able to lower the CPU speed by running `apm -L`.

How much electricity have you saved by that?

> I haven't been able to spin down the hard drives.

How much resources would that save?

I you are concerned about resources, wouldn't you be better off
getting a low-power machine, with SSD disks?  There are machines
out there that eat around 10W and get the job done (dependeing
on the job of course); and SSD doesn't need to spin down.

> I cannot share the full dmesg for security reasons

Bullshit.



Re: Configure OpenBSD for remote server rarely used

2022-11-27 Thread T K
"I have been able to lower the CPU speed by running `apm -L`."
For automation purposes consider using obsdfreqd (pkg_add obsdfreqd)
instead.

niedz., 27 lis 2022, 10:39 użytkownik James Johnson 
napisał:

> Hi all,
>
> OpenBSD is amazing. But I need help in configuring it correctly as a
> remote server, rarely used.
>
>
> The main thing I am trying to do is to make it sleep every now and then to
> protect resources. I am very flexible on how to do this, but have been
> unable to do so.
> Here's what I tried :
>
> 1) Make it sleep and wake up when woken up remotely
> I investigated Wake On Lan, which I enabled via ifconfig. However, this
> system is deployed remotely, and I have no access to other computers on the
> LAN, so I am unable to make this work.
>
> 2) Make it sleep for a few hours and then wake up
> After 3hours+ of research in man pages and the internet, I have not seen
> any solution for that.
>
> 3) hard drives Spin down, CPU lower freq
>
> I have been able to lower the CPU speed by running `apm -L`.
> I haven't been able to spin down the hard drives.
> How important is it to manually send a command to spin down the unused
> harddrives? Will it be down by the system automatically?
>
> I am trying to get info on the drives from the system but `atactl sd0
> checkpower ` always shows `standby` even after I have just written on the
> disk. I understand this does not work because my drives are SCSI and not
> ATA.
> I read the man page for scsi, and I see the command to spin down hard
> drives : `scsi -f /dev/rsd2c -c "1b 0 0 0 0 0"`
> However, I see no command to spin them back up. Is it automatic?
> How can I request information on the spin state of the drive. I am just a
> little worried about starting to send low levels instructions to the hard
> drive, with little understanding of it. Is it safe to send this command?
>
> Thanks all !
>
>
> PS : dmesg : I cannot share the full dmesg for security reasons, but it is
> a fairly standard i386 machine, with 2 drives mounted as SCSI.
>
>
>
>