Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low Power Mode #4137

Closed
jcgruenhage opened this issue Aug 11, 2017 · 7 comments
Closed

Low Power Mode #4137

jcgruenhage opened this issue Aug 11, 2017 · 7 comments

Comments

@jcgruenhage
Copy link

Type: Feature

Severity: Medium

Description:

IPFS on Android (with IPFSDroid) already works kinda well, but having the app running is currently not an option, because it sucks your battery empty in no time. Would it be possible, to implement an API call, that switches a node into low power (and possibly also into low bandwidth) mode, so that running this on mobile devices is more doable? Killing the node all the time would be another way, but that does kinda defeat the purpose of IPFS.

@Kubuxu
Copy link
Member

Kubuxu commented Aug 11, 2017

First step would be probably running go-ipfs in DHT client mode:
ipfs daemon --routing=dhtclient

We are working on connection closing which should further reduce the number of connections thus reducing bandwidth and power usage.

@jcgruenhage
Copy link
Author

Thanks :)

@whyrusleeping
Copy link
Member

Yeah, as @Kubuxu pointed out you probably want to use --routing=dhtclient. Its probably also worth turning off the reprovider with: ipfs config Reprovider.Interval "0" so your node doesnt rebroadcast all this things it has every 12 hours.

@Stebalien
Copy link
Member

Note: Bitswap sessions (#3786) will help reduce background traffic significantly.

@jbshirk
Copy link

jbshirk commented Oct 26, 2018

Cross ref
https://discuss.ipfs.io/t/sweet-ipfs-full-ipfs-node-for-android/3779/16

@hazae41
Copy link

hazae41 commented Dec 15, 2018

Sweet-IPFS 0.2.2 adds a "low power" mode by using this config

"Swarm": {
    "ConnMgr": {
      "LowWater": 20,
      "HighWater": 100,
      "GracePeriod": "80s"
    }
  }

@lidel
Copy link
Member

lidel commented Nov 17, 2022

lowpower profile was implemented a while ago. it is shutting down various things to decrease impact on battery:

kubo/config/profile.go

Lines 171 to 187 in 6f730dc

"lowpower": {
Description: `Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data
fetching may be degraded.
`,
Transform: func(c *Config) error {
c.Routing.Type = "dhtclient"
c.AutoNAT.ServiceMode = AutoNATServiceDisabled
c.Reprovider.Interval = "0"
lowWater := int64(20)
highWater := int64(40)
gracePeriod := time.Minute
c.Swarm.ConnMgr.Type = NewOptionalString("basic")
c.Swarm.ConnMgr.LowWater = &OptionalInteger{value: &lowWater}
c.Swarm.ConnMgr.HighWater = &OptionalInteger{value: &highWater}
c.Swarm.ConnMgr.GracePeriod = &OptionalDuration{&gracePeriod}

Future work would be to default to a pool of gateways hosting blocks / CARs and starting up P2P/DHT only as a fallback, but that would be tracked in a separate issue.

@lidel lidel closed this as completed Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

7 participants