Vanilla promised are not cancelable. That's kinda the point. Can you wrap it? see https://github.com/petkaantonov/bluebird
I'm looking with fiatjaf directly. It's a problem in nostr-tools. Currently testing something
Oh! It's related to relay connection! I'll deep on it
This is my main issue on Nostr Proxy.
After running for ~1 hour (locally) with 15-20 clients connected to it, I closed all clients. Everything got cleaned correctly, but not these Promises. 534k Promises...
That's why Nostr Proxy crashes after a while. If anyone can help with this analysis, contact me please.
I can't find any information in the memory heap snapshots

OMG, my first Zap? Thanks #[1] !
Nostr Proxy stress test time!
https://nproxy.zerologin.co or https://nproxy.cc (or both)
Welcome sir #[0]
Did you remember twitter? It was an old social network back in the good old days
Is it a good UX to always have to click on "Show X new notes" instead of displaying them directly in the thread?
I'm on iris.to. Let's try it
So... if you are connected to either nproxy.zerologin.co or nproxy.cc, just publish things to stress test the proxy!
(nproxy.cc should be better)
Subscribing to events looks fine.
Leaks appeared only on publish events, that's why it could take many hours before crash
Oh, I found a beautiful memory leak in nostr-tools!
Fixed on my branch, let's try this!
GM it crashed again
Nostr proxy is running for more an hour without RAM or CPU issue!
If it stay alive all the night, I could say it's "stable".
Try it here
https://nproxy.zerologin.co (deployed on a VPS)
https://nproxy.cc (deployed on railway)
Stats are funny (no)
VPS: 20 currents connections - 50-100Mo RAM
Railway: 2 currents connection - ~140Mo RAM
VPS one died.
But wtf, I can't believe it. Is there an attacker?
My two proxy on VPS and Railway got full of RAM at the same time
Nostr proxy is running for more an hour without RAM or CPU issue!
If it stay alive all the night, I could say it's "stable".
Try it here
https://nproxy.zerologin.co (deployed on a VPS)
https://nproxy.cc (deployed on railway)
Stats are funny (no)
VPS: 20 currents connections - 50-100Mo RAM
Railway: 2 currents connection - ~140Mo RAM
First, I'm using a branch named "heap" for all my tests.
I'll merge as soon as I resolved perf issues (it should be ok very soon™️!)
Then I'll write a robust readme for deploying.
I can also make "Deploy on railway" button into the readme when it's ready.
I know they offer free credits for each deployments if the project is open source and has 100+ stars on github. It could be very great for me 😅
Anyway, I can send you a batch env example in DM, but it can change fast
- Having only 1 WS connection instead of X results in battery/bandwidth eco.
- Hide your IP address to relays (only the proxy knows your IP, but you can self host the proxy)
I have disabled schnorr signature validation and... It works!
I have some peak at 100%+ sometimes, but it's under 10-20% all the time
I will start with caching validated events. It's not useful to validate signature of an already validated event.
If it's still to CPU intensive, I'll give up schnorr validation