aaron on Nostr: This will depend to a significant degree on which relay implementation you are using. ...
This will depend to a significant degree on which relay implementation you are using.
If the implementation doesn't use multiple cores, then you won't see much advantage scaling out vcpus.
Also consider what db does the relay use and how do they use it? Does it support concurrent writes?
Does the relay index subscriptions so it doesn't have to iterate on every subscription each time a new event arrives?
Probably we need to improve our relay code. Very modest hardware with little concurrency should be able to support much more than 20 notes per second.
My relay runs on the smallest gcp machine (2 vcpus) and median *note* write latencies are <3ms. This is with little optimization on writes, so should be able to support a least 100s of writes/sec on basic hardware eventually.
Indexing subscriptions should mean the time to dispatch a note to subscription should remain small assuming most subscriptions are not firehose/global feed filters.
Published at
2023-02-04 15:20:09Event JSON
{
"id": "678d279a9b611c2a6ed4f060edad35c22e4f3321f943c6649192da46b407ff56",
"pubkey": "aff9a9f017f32b2e8b60754a4102db9d9cf9ff2b967804b50e070780aa45c9a8",
"created_at": 1675524009,
"kind": 1,
"tags": [
[
"e",
"88454bcd10ff75616a05701310884db389d539fcfe1485659ebb0fba9d81d71c",
"",
"root"
],
[
"e",
"7136fcc5fdeab8bfa22b41fb134d771d3a22d1e638c29c925ab90df1cb12f4fa",
"",
"reply"
],
[
"p",
"132f5f2b368b4c6d04002efcc9058fc8aecacc88bdd1a67d4785012f04905181"
],
[
"p",
"597b42de56a9e0c19ee2d0cde5797dd58d48ce8dd25c732b4c873af11161f9fd"
]
],
"content": "This will depend to a significant degree on which relay implementation you are using. \n\nIf the implementation doesn't use multiple cores, then you won't see much advantage scaling out vcpus.\n\nAlso consider what db does the relay use and how do they use it? Does it support concurrent writes?\n\nDoes the relay index subscriptions so it doesn't have to iterate on every subscription each time a new event arrives?\n\nProbably we need to improve our relay code. Very modest hardware with little concurrency should be able to support much more than 20 notes per second.\n\nMy relay runs on the smallest gcp machine (2 vcpus) and median *note* write latencies are \u003c3ms. This is with little optimization on writes, so should be able to support a least 100s of writes/sec on basic hardware eventually.\n\nIndexing subscriptions should mean the time to dispatch a note to subscription should remain small assuming most subscriptions are not firehose/global feed filters.",
"sig": "52d33b80e118894083affa5b552d68eb60833a247aa4a2db5a251e9c73d8e9529af4c5ce091f94bb6420e16e25df884b7509cf929fdfb69009bc3282bbdf56ed"
}