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

Connected to peers but no new data #11

Open
christianbundy opened this issue Dec 17, 2019 · 11 comments
Open

Connected to peers but no new data #11

christianbundy opened this issue Dec 17, 2019 · 11 comments

Comments

@christianbundy
Copy link
Contributor

Hi! Not urgent, but this morning I started my computer and checked SSB for messages but I didn't download any new ones. I can confirm that I was connected to a handful of pubs that should have messages for me, but no new messages were being downloaded. Running ssb conn stop; ssb conn start seemed to resolve the issue. Anything I can do to help debug the next time this happens?

@staltz
Copy link
Member

staltz commented Dec 17, 2019

That sounds unusual. You can try putting the env var DEBUG='*' in front of your terminal command, or inside node.js scripts have process.env.DEBUG = '*'. This should enable a lot more detailed debugging logs from CONN.

@christianbundy
Copy link
Contributor Author

It's so intermittent that I've had trouble debugging it with DEBUG='*', but it just happened again. Hmm.

It looks like SSB-CONN was connecting to a few peers, but after an hour without any new content I tried an ssb gossip reconnect and the new messages came in without any problems. Maybe it's a problem of expectations: how often does SSB-CONN do the equivalent of ssb gossip reconnect?

@staltz
Copy link
Member

staltz commented Dec 23, 2019

@christianbundy Do you have in your ssb config {conn: {autostart: false}}? That would disable the scheduler. If it's undefined, it defaults to true.

In ssb-conn, ssb gossip reconnect does a simple ssb.conn.hub().reset(). In the scheduler in ssb-conn, it also does a reset when the network interfaces change or when the computer wakes up from sleep mode. This is copy pasted from ssb-gossip:

    // Upon wakeup, trigger hard reconnect
    onWakeup(() => this.ssb.conn.hub().reset());

    // Upon network changes, trigger hard reconnect
    onNetwork(() => this.ssb.conn.hub().reset());

Is it so that you were connected with peers, and replication (ssb-replicate) was not happening with them, but a ssb gossip reconnect made you replicate with them? (I'm trying to figure out if this bug could be a problem in ssb-replicate, not ssb-conn). That said, I think hub.reset() actually closes connections with all current peers.

Conclusion: so far I'm still confused by this bug.

@christianbundy
Copy link
Contributor Author

Nope, I've got the default ssb-config.

Is it so that you were connected with peers, and replication (ssb-replicate) was not happening with them, but a ssb gossip reconnect made you replicate with them?

I was connected to peers, but it didn't seem to be connecting to new peers. My intuition is that the replication is working fine, but that it's not connecting to new peers as often as I'd expect. I was able to use conn.hub().reset() to manually force SSB-CONN to talk to different peers, but it didn't seem to be doing that by default. How often should I expect the connection scheduler to switch to different peers?

@staltz
Copy link
Member

staltz commented Dec 23, 2019

Is this behavior noticeably different than what you had before with ssb-gossip? The ssb-conn scheduler mostly follows the legacy scheduler in ssb-gossip.

Every 30min, connections to pubs are shut down (and this frees up space for new connections).

See https://github.com/staltz/ssb-conn/blob/014c407cdaa722e9a04906a1678b463dc06356b6/src/conn-scheduler.ts#L341-L347

In general I recommend getting acquainted with the scheduler source code file, it has good comments.

@christianbundy
Copy link
Contributor Author

Is this behavior noticeably different than what you had before with ssb-gossip? The ssb-conn scheduler mostly follows the legacy scheduler in ssb-gossip.

I'm not sure. Lately I've been experimenting with running Oasis as a daemon instead of starting it when I want to use it, so maybe that's the difference? In the past I'd open Patchwork or Oasis and it'd immediately connect to a bunch of peers, but now I'm opening Oasis after it's been running for 48 hours so it's at a random point in the replication schedule. Maybe I've just been getting unlucky?

@christianbundy
Copy link
Contributor Author

Finally had this happen when I had the debug mode on, so I've got detailed logs. At a first pass I think it happened like this:

  • My laptop was suspended with Oasis running
  • After a few hours I opened my laptop
  • SSB-CONN noticed the wakeup and tried to connect to peers
  • A few connection attempts were made but only two seemed to succeed (neither give us any messages)
  • 10 minutes later, more connections are attempted and one succeeds (which gives us messages)

Are there any important privacy implications I should be aware of before posting my DEBUG='ssb-conn*' logs? I've skimmed and don't see any personal info, but I've been meaning to ask you regardless.

@staltz
Copy link
Member

staltz commented Dec 26, 2019

That sequence of events sounds reasonable. Those two peers that were connected but didn't give you new messages: are you sure there were new messages that those peers could give you? In my experience some peers have a slice of the social graph that other peers don't have.

Are there any important privacy implications I should be aware of before posting my DEBUG='ssb-conn*' logs? I've skimmed and don't see any personal info, but I've been meaning to ask you regardless.

It might show IP addresses and SSB IDs, but usually only IP addresses for pubs. So if you think your logs look fine, I think regarding privacy it should be okay, but on the other hand I'm not 100% sure what your logs show.

@christianbundy
Copy link
Contributor Author

Those two peers that were connected but didn't give you new messages: are you sure there were new messages that those peers could give you?

No, I'm not sure which messages they have, and I don't think there's a technical bug in the scheduler. My point is that ten minutes of peering with people who don't have any messages for you seems sub-optimal, and since I bump into this often I'd love to brainstorm why it happens and how to fix it.

  • Maybe I have too many conn.json entries and lots of them are inactive?
  • Maybe my 3-hop config means that conn.json has lots of peers that don't follow who I follow?
  • Maybe my network interface isn't ready immediately after a resume?

Possible solutions off the top of my head:

  • If a connection attempt fails, maybe we should try another one? The docs mention that the scheduler connects to "5 staged peers we follow", but it's very common for me to only be connected to 2 peers. Maybe that's just the exponential backoff?
  • This might be resource-intensive, but maybe we should prioritize peers who follow people that we follow so that we can get those messages. If we follow a peer then we can connect knowing that it will have info about itself (1 feed), but it might be more useful to connect to peers that follow lots of our friends (>1 feed).

Maybe you'll have some insight here? I'll attach my logs below in case you find them useful:

relevant log from when I resumed my computer from suspend
2019-12-26T02:46:52.285Z ssb:conn-hub disconnected from net:ssb-pub.peach-town.xyz:8008~shs:wKaaftUxisV3GA3zuk2ena5krzJgB/6HwvgOKKIR/jQ=
2019-12-26T02:46:52.307Z ssb:conn-hub disconnected from net:usw.ssbpeer.net:8008~shs:MauI+NQ1dOg4Eo5NPs4OKxVQgWXMjlp5pjQ87CdRJtQ=
2019-12-26T02:46:52.461Z ssb:conn-hub connecting to net:evbogue.com:8008~shs:9sCXwCJZJ9doPcx7oZ1gm7HNZapO2Z9iZ0FJHJdROio=
2019-12-26T02:46:52.461Z ssb:conn-staging unstaged peer net:45.55.213.91:8008~shs:9sCXwCJZJ9doPcx7oZ1gm7HNZapO2Z9iZ0FJHJdROio=
2019-12-26T02:46:52.466Z ssb:conn-hub connecting to net:ssb.tapenet.org:8008~shs:zjpqlL8E6IRNrVmS8UKplIsRDyabo4x2l4m4x95ydtE=
2019-12-26T02:46:52.472Z ssb:conn-hub connecting to net:gitlab.anomalistdesign.com:8008~shs:PAo/tIAE3ejLvHXKvATYAinB/qUWSOH2Zs/whpxRlQY=
2019-12-26T02:46:52.478Z ssb:conn-hub connecting to net:139.59.59.26:8008~shs:oe2v/ge57BaD3+zAGKqbZLxXyqsGuQMCFwtBwvbS3+Y=
2019-12-26T02:46:52.480Z ssb:conn-hub connecting to net:ssb.dziban.net:8008~shs:MjbwUshWlmNQIc9d3fdDr06xhS/j8G88aTQtHKSqcEg=
2019-12-26T02:46:52.482Z ssb:conn-hub failed to connect to net:139.59.59.26:8008~shs:oe2v/ge57BaD3+zAGKqbZLxXyqsGuQMCFwtBwvbS3+Y=
2019-12-26T02:46:52.493Z ssb:conn-hub failed to connect to net:evbogue.com:8008~shs:9sCXwCJZJ9doPcx7oZ1gm7HNZapO2Z9iZ0FJHJdROio=
2019-12-26T02:46:52.493Z ssb:conn-hub failed to connect to net:ssb.tapenet.org:8008~shs:zjpqlL8E6IRNrVmS8UKplIsRDyabo4x2l4m4x95ydtE=
2019-12-26T02:46:52.493Z ssb:conn-hub failed to connect to net:gitlab.anomalistdesign.com:8008~shs:PAo/tIAE3ejLvHXKvATYAinB/qUWSOH2Zs/whpxRlQY=
2019-12-26T02:46:52.494Z ssb:conn-hub failed to connect to net:ssb.dziban.net:8008~shs:MjbwUshWlmNQIc9d3fdDr06xhS/j8G88aTQtHKSqcEg=
2019-12-26T02:46:53.494Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:46:53.518Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:46:54.989Z ssb:conn-hub failed to connect to net:192.168.0.104:8008~shs:GSuGLzJa8t3aJCLvs66Ekn7MXdr3yqCSzsd6z2iUEBY=;ws://192.168.0.104:8989~shs:GSuGLzJa8t3aJCLvs66Ekn7MXdr3yqCSzsd6z2iUEBY=
2019-12-26T02:46:55.701Z ssb:conn-staging staged peer net:45.55.213.91:8008~shs:9sCXwCJZJ9doPcx7oZ1gm7HNZapO2Z9iZ0FJHJdROio=
2019-12-26T02:46:55.712Z ssb:conn-hub connecting to net:kejsarkungen.se:8008~shs:buRic8fwxQn2So6xxng/QayC24hmMicZWmsZFOPqUtc=
2019-12-26T02:46:55.717Z ssb:conn-hub connecting to net:142.93.206.81:8008~shs:mMUzfa6P1yHelURpSAcPtLaZbEy9y34KImGaFunwEmA=
2019-12-26T02:46:55.729Z ssb:conn-hub failed to connect to net:142.93.206.81:8008~shs:mMUzfa6P1yHelURpSAcPtLaZbEy9y34KImGaFunwEmA=
2019-12-26T02:46:55.729Z ssb:conn-hub failed to connect to net:kejsarkungen.se:8008~shs:buRic8fwxQn2So6xxng/QayC24hmMicZWmsZFOPqUtc=
2019-12-26T02:46:56.729Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:46:56.745Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:46:57.212Z ssb:conn-hub connecting to net:ssb.nycresistor.com:8008~shs:OPZyY9zbFdUoTbYDFBwR6V+DspEwGQ9jb5WS9hM/8GM=
2019-12-26T02:46:57.217Z ssb:conn-hub connecting to net:ssb.dapp.org:8008~shs:/Ubxodt6PeUvFw1967tWlbasVnjxNn1lO4k5WB9duPA=
2019-12-26T02:46:57.226Z ssb:conn-hub failed to connect to net:ssb.nycresistor.com:8008~shs:OPZyY9zbFdUoTbYDFBwR6V+DspEwGQ9jb5WS9hM/8GM=
2019-12-26T02:46:57.227Z ssb:conn-hub failed to connect to net:ssb.dapp.org:8008~shs:/Ubxodt6PeUvFw1967tWlbasVnjxNn1lO4k5WB9duPA=
2019-12-26T02:46:58.228Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:46:58.256Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:46:59.741Z ssb:conn-hub connecting to net:gitmx.com:8008~shs:Mab2bvJENd7R18GitGDzjG4cVKHB+1pvr3cHPeSIk/s=
2019-12-26T02:46:59.745Z ssb:conn-hub connecting to net:sbot.wetsand.co.nz:8008~shs:hglaBAkpc6wuyBb5KguZR/dTISB7jP+LTonWVetfrT8=
2019-12-26T02:46:59.765Z ssb:conn-hub connecting to net:46.101.172.118:8008~shs:vU/bDokQrQro6t835MkjGct+dmygIv4zkd4oV3UNhgc=
2019-12-26T02:46:59.768Z ssb:conn-hub connecting to net:ssb.e-mesh.net:8008~shs:AWf8Wn299ZUH7t+JAJL6B217LhDxfHEjgoGOXoYmNjY=
2019-12-26T02:46:59.930Z ssb:conn-hub failed to connect to net:sbot.wetsand.co.nz:8008~shs:hglaBAkpc6wuyBb5KguZR/dTISB7jP+LTonWVetfrT8=
2019-12-26T02:47:00.121Z ssb:conn-hub failed to connect to net:gitmx.com:8008~shs:Mab2bvJENd7R18GitGDzjG4cVKHB+1pvr3cHPeSIk/s=
2019-12-26T02:47:00.220Z ssb:conn-hub connected to net:ssb.e-mesh.net:8008~shs:AWf8Wn299ZUH7t+JAJL6B217LhDxfHEjgoGOXoYmNjY=
2019-12-26T02:47:00.307Z ssb:conn-hub disconnected from net:ssb.e-mesh.net:8008~shs:AWf8Wn299ZUH7t+JAJL6B217LhDxfHEjgoGOXoYmNjY=
2019-12-26T02:47:00.314Z ssb:conn-hub connected to net:46.101.172.118:8008~shs:vU/bDokQrQro6t835MkjGct+dmygIv4zkd4oV3UNhgc=
2019-12-26T02:47:00.529Z ssb:conn-hub connecting to net:ssb.alarum.de:8008~shs:TRE4lNNXrtx3KK9Tgks2so2PjCP6w9tRvsy7wyqiyo4=
2019-12-26T02:47:00.535Z ssb:conn-hub connecting to net:ssb.meshwithme.online:8008~shs:AWf8Wn299ZUH7t+JAJL6B217LhDxfHEjgoGOXoYmNjY=
2019-12-26T02:47:00.909Z ssb:conn-hub connected to net:ssb.meshwithme.online:8008~shs:AWf8Wn299ZUH7t+JAJL6B217LhDxfHEjgoGOXoYmNjY=
2019-12-26T02:47:01.021Z ssb:conn-hub failed to connect to net:ssb.alarum.de:8008~shs:TRE4lNNXrtx3KK9Tgks2so2PjCP6w9tRvsy7wyqiyo4=
2019-12-26T02:47:02.022Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:47:02.065Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:52:01.218Z ssb:conn-hub connecting to net:pub.locksmithdon.net:8008~shs:5Iy0jt/wxI84VmdFeTdDedXjI1zyAU6BXQvb4DUyZIE=
2019-12-26T02:52:01.224Z ssb:conn-hub connecting to net:167.99.184.69:8008~shs:nJNCO+4+36dQadEyqEV+x6KKyWL8DyreUR1XbB37J/Y=
2019-12-26T02:52:01.227Z ssb:conn-hub connecting to net:h.iovoid.xyz:8008~shs:SbzosaDRRbxFO31q/PAXDmbc3jTbRhNalFIdPAnAny4=
2019-12-26T02:52:01.231Z ssb:conn-hub connecting to net:fnusk.com:8008~shs:c8UHQWWm5qptzY/SZ3kn5r8DhI6DR2S6fspFKbWYST4=
2019-12-26T02:52:01.234Z ssb:conn-hub connecting to net:pub.heropunch.io:8008~shs:1prDUQEM6oSx9fSzRlMILqtW7EQEtGUKuv6GaqtcJLM=
2019-12-26T02:52:01.246Z ssb:conn-hub failed to connect to net:pub.locksmithdon.net:8008~shs:5Iy0jt/wxI84VmdFeTdDedXjI1zyAU6BXQvb4DUyZIE=
2019-12-26T02:52:01.298Z ssb:conn-hub failed to connect to net:167.99.184.69:8008~shs:nJNCO+4+36dQadEyqEV+x6KKyWL8DyreUR1XbB37J/Y=
2019-12-26T02:52:01.304Z ssb:conn-hub failed to connect to net:h.iovoid.xyz:8008~shs:SbzosaDRRbxFO31q/PAXDmbc3jTbRhNalFIdPAnAny4=
2019-12-26T02:52:02.304Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:52:02.336Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:52:06.646Z ssb:conn-hub failed to connect to net:pub.heropunch.io:8008~shs:1prDUQEM6oSx9fSzRlMILqtW7EQEtGUKuv6GaqtcJLM=
2019-12-26T02:52:07.647Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:52:07.677Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:52:13.031Z ssb:conn-hub disconnecting from net:fnusk.com:8008~shs:c8UHQWWm5qptzY/SZ3kn5r8DhI6DR2S6fspFKbWYST4=
2019-12-26T02:52:13.032Z ssb:conn-hub disconnected from net:fnusk.com:8008~shs:c8UHQWWm5qptzY/SZ3kn5r8DhI6DR2S6fspFKbWYST4=
2019-12-26T02:52:14.032Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:52:14.061Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:52:33.636Z ssb:conn-hub failed to connect to net:fnusk.com:8008~shs:c8UHQWWm5qptzY/SZ3kn5r8DhI6DR2S6fspFKbWYST4=
2019-12-26T02:52:34.637Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:52:34.676Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:57:01.505Z ssb:conn-hub connecting to net:sbom.tilde.website:8008~shs:FgG26a7IUtLBpbr5z1GBYp16gMMvcS6j4koumlMoWIk=
2019-12-26T02:57:01.511Z ssb:conn-hub connecting to net:ssb.ockchain.net:8008~shs:Gkl3j7/Qo3xRlzx13e6GnyeS6rhDJx9FmUWiKcqUk+U=
2019-12-26T02:57:01.513Z ssb:conn-hub connecting to net:pub.squi.cc:8008~shs:Ct1vWHZBmZJXCJEkDUfq3VnDPaOAKyNUesZck7lW6TE=
2019-12-26T02:57:01.549Z ssb:conn-hub failed to connect to net:ssb.ockchain.net:8008~shs:Gkl3j7/Qo3xRlzx13e6GnyeS6rhDJx9FmUWiKcqUk+U=
2019-12-26T02:57:01.596Z ssb:conn-hub failed to connect to net:pub.squi.cc:8008~shs:Ct1vWHZBmZJXCJEkDUfq3VnDPaOAKyNUesZck7lW6TE=
2019-12-26T02:57:02.049Z ssb:conn-hub failed to connect to net:sbom.tilde.website:8008~shs:FgG26a7IUtLBpbr5z1GBYp16gMMvcS6j4koumlMoWIk=
2019-12-26T02:57:03.051Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:57:03.077Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:57:33.848Z ssb:conn-hub connecting to net:dispatch.sprig.gs:8008~shs:xp+ZlMOuhjiDHywThMB8pPsGvWjZH7qFKnRK8Y/0VTE=
2019-12-26T02:57:33.852Z ssb:conn-hub connecting to net:raspberrypi.red.quintana.libre.org.ar:8008~shs:YRSqGsK+elQEK7BDWh5IUHTQ8oifLU8v2+Z9wHr8NA4=
2019-12-26T02:57:34.618Z ssb:conn-hub connected to net:dispatch.sprig.gs:8008~shs:xp+ZlMOuhjiDHywThMB8pPsGvWjZH7qFKnRK8Y/0VTE=
2019-12-26T02:57:35.638Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:57:35.947Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T02:57:43.862Z ssb:conn-hub failed to connect to net:raspberrypi.red.quintana.libre.org.ar:8008~shs:YRSqGsK+elQEK7BDWh5IUHTQ8oifLU8v2+Z9wHr8NA4=
2019-12-26T02:57:44.863Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T02:57:44.897Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T03:02:03.042Z ssb:conn-hub connecting to net:199.167.59.81:8008~shs:+ujMpyQZXb67nkpjjj86uxMmtsl7R+5CY1z39aeCBjI=
2019-12-26T03:02:03.047Z ssb:conn-hub connecting to net:ssb.exitsystemcall.com:8008~shs:gSb2Dt4qtUSIt0jV1yrugKPiBriKPIUFfYB574vWhrM=
2019-12-26T03:02:03.051Z ssb:conn-hub connecting to net:tilde.home.kg:8008~shs:vUNnVJXZlwqKncuBqd4QkB8ScbanX+YmYzwvdoMZJG8=
2019-12-26T03:02:03.148Z ssb:conn-hub failed to connect to net:199.167.59.81:8008~shs:+ujMpyQZXb67nkpjjj86uxMmtsl7R+5CY1z39aeCBjI=
2019-12-26T03:02:03.175Z ssb:conn-hub failed to connect to net:ssb.exitsystemcall.com:8008~shs:gSb2Dt4qtUSIt0jV1yrugKPiBriKPIUFfYB574vWhrM=
2019-12-26T03:02:04.176Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T03:02:04.201Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T03:02:05.390Z ssb:conn-hub failed to connect to net:tilde.home.kg:8008~shs:vUNnVJXZlwqKncuBqd4QkB8ScbanX+YmYzwvdoMZJG8=
2019-12-26T03:02:06.391Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T03:02:06.431Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T03:02:45.014Z ssb:conn-hub connecting to net:fc34:565a:966f:61e5:1c43:4775:ca8b:8583:8008~shs:zWHyJ0HN4kUeatim4lsAOsClmbx+fkBkooON7uBlUC0=
2019-12-26T03:02:45.016Z ssb:conn-hub connecting to net:ssb.vanmesh.net:8008~shs:Pjax8DtaImGrm/xGMfNkyd4BaVG/cFP2W1iFTpCMj8U=
2019-12-26T03:02:45.017Z ssb:conn-hub failed to connect to net:fc34:565a:966f:61e5:1c43:4775:ca8b:8583:8008~shs:zWHyJ0HN4kUeatim4lsAOsClmbx+fkBkooON7uBlUC0=
2019-12-26T03:02:46.018Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T03:02:46.044Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T03:02:55.853Z ssb:conn-hub disconnecting from net:ssb.vanmesh.net:8008~shs:Pjax8DtaImGrm/xGMfNkyd4BaVG/cFP2W1iFTpCMj8U=
2019-12-26T03:02:55.853Z ssb:conn-hub disconnected from net:ssb.vanmesh.net:8008~shs:Pjax8DtaImGrm/xGMfNkyd4BaVG/cFP2W1iFTpCMj8U=
2019-12-26T03:02:56.854Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T03:02:56.876Z ssb:conn-db Done serializing and writing ConnDB into conn.json
2019-12-26T03:03:17.476Z ssb:conn-hub failed to connect to net:ssb.vanmesh.net:8008~shs:Pjax8DtaImGrm/xGMfNkyd4BaVG/cFP2W1iFTpCMj8U=
2019-12-26T03:03:18.496Z ssb:conn-db Begun serializing and writing ConnDB into conn.json
2019-12-26T03:03:18.509Z ssb:conn-db Done serializing and writing ConnDB into conn.json

@staltz
Copy link
Member

staltz commented Dec 27, 2019

(@dominictarr I'm @ mentioning you in this comment concerning the gossip scheduler and EBT replication. see below)

@christianbundy I recommend tweaking the parameters in this function below until you find numbers that satisfy you, then make a PR and we can discuss about whether those parameters would be a good default for all users:

https://github.com/staltz/ssb-conn/blob/014c407cdaa722e9a04906a1678b463dc06356b6/src/conn-scheduler.ts#L262-L348

The docs mention that the scheduler connects to "5 staged peers we follow", but it's very common for me to only be connected to 2 peers.

The important detail here is the word staged. It basically means that all (but only up to 5) peers that I follow which are currently in ssb-conn-staging (such as LAN peers or Bluetooth peers, but pubs can also be staged), those we will connect to automatically. I think in your case you had no staged peers, so it didn't connect to 5 of them, just 2, because it followed other logic. See that function source code, it shows it.

That said, I also notice that on my side (Patchwork and often Manyverse) I also have just 2 peers connected. Sometimes 3. I think we should aim for most of the time 3 peers, and if there are 2 peers, then actively try to connect to another 3rd one. I think this can be done by just tweaking the numbers in that function. I remember talking with @dominictarr that if EBT is enabled, then peers connections should not be short-lived, so I'm trying to not have too much churn in the scheduler. I could be wrong though.

@staltz
Copy link
Member

staltz commented Dec 27, 2019

just 2 peers

Oh, I think that usually it's 1 room plus 1 pub. It should be at least 2 pubs, because a room doesn't count as a replication peer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants