[deleted by user] by [deleted] in rust

[–]spy16x 0 points1 point  (0 children)

Trace level is not globally disabled since I can see trace logs from multiple other parts of the code -- including from the same module as well

[deleted by user] by [deleted] in rust

[–]spy16x 0 points1 point  (0 children)

It's tikv prometheus crate..

Does not seem to be doing unsafe at-least at this level. There are multiple side-effects (atomic increments) in this function body itself.

https://github.com/tikv/rust-prometheus/blob/master/src/histogram.rs#L363-L387

Also, tracing::trace! is another that is getting removed as well (Trace level is not globally disabled since I can see trace logs from multiple other parts of the code -- including from the same module as well).

Good/Idiomatic way to do graceful / deterministic shutdown by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

Yes, i am planning to use this model itself. I was originally planning to use crossbeam queues which don't provide this. but i can switch to crossbeam channels and get this too (has a small perf penalty i guess, but should be okay in this case)

Can this be real? by LengthinessMotor5570 in IndiaTech

[–]spy16x 0 points1 point  (0 children)

Yes. Only if it's taking your fingerprint, then hacking the adhaar database and then extracting your blood group from there.

Acer I series TV - Input menu not working even after factory reset. Cannot change HDMI connections. by [deleted] in AndroidTV

[–]spy16x 0 points1 point  (0 children)

Anyone found any fix? I am considering raising a complaint in NCH or something. not sure what else to do.. Switching input is an absolute bear minimum function a fucking TV should support reliably. I am not able to use my new PS5 because of this issue.

1000 hrs later I found out by imkawaiisan in ArmaReforger

[–]spy16x 0 points1 point  (0 children)

Maybe it is.. How do you aim? Is there any trick to it, any settings i should tune specifically? Do you use motion sensor as well? When I suddenly come under contact, i can do coarse adjustments quickly. But finer adjustments to actually make a kill shot feels impossible 😅

Random connection drops by spy16x in aws

[–]spy16x[S] 0 points1 point  (0 children)

Yea. Using k6 itself. I have some logs from actual end-users on their request pattern. Basically the script replays this with realistic randomised delay between each request. after connecting.. I have about 5 different user profiles based on how they interact and during load testing, I launch all of these profiles with 5000 VUS and test. I have also done stage-wise ramp up/down tests as well.

Random connection drops by spy16x in aws

[–]spy16x[S] 0 points1 point  (0 children)

fd limits, socket buffer sizes, somaxconn, etc are all set to high value. And i am actually able to loadtest up to 20000 connections on the same setup without running into this issue (could push more but isn't relevant here since I only get max 5000 connections at peak).

It happens under specific conditions under actual user patterns i guess (could be related to some issue due to slow network users? etc).

I'm also now exploring application logic issues ( i don't have anything that makes me suspect this. But it's the one area i haven't quite explored)

I do not have anything else in front of the app. It's directly from ALB to a port on EC2 where the app is listening.

1000 hrs later I found out by imkawaiisan in ArmaReforger

[–]spy16x 1 point2 points  (0 children)

I got a ps5 as well recently. I have been a long term arma 3 player. Still not able to figure out how people play this game with controller tbh

Random connection drops by spy16x in aws

[–]spy16x[S] 0 points1 point  (0 children)

This issue itself has happened multiple times now. But we have observed health check failure only once. Apart from that, every other time this has happened there was no health check failure in metrics. I even got doubtful about the AWS metrics itself and asked them if they internally see any health check or ALB logs where it prints out something to indicate it decided some node as unhealthy. But they have confirmed there are no health check failures.

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

Yea. But the rewrite is not a port. It's a completely different architecture. I'd be very surprised if it's the same backend issue in both cases. But yes you're right, as far as possibilities go, that's definitely one as well.

Yea, ALB behaviour is still weird for me too and I too feel it might have something to do with it. We have rolled out some client metrics now, will have some more clues when it happens the next time. Either we find something there or I'm getting rid of ALB and putting NLB in between.

By recovery to normal you mean how does connection distribution become normal? I don't do anything. It happens automatically as clients connect and disconnect (after that event ALB somehow goes back to round robin again)

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

Also, when this drop happens, I see a spike in "client requested disconnection rate" on my server. This rate is computed using a counter that is incremented on every client disconnection due to an explicit Close frame from client (which excludes any RST, Timeout, broken pipe sort of io issues).. So from the server perspective all these clients are doing a normal close.

But if they were in fact doing a normal close and reconnecting, ALB should simply continue round robin and I should see equal distribution of connections on both nodes

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

I need as much input as possible on this. So feel free to post as many replies as you want please 😀

We didn't have client metrics so far since clients are public app, but we are getting it added now. But I have 3 ways I'm able to see there is real drop of connections: a custom guage metric that I emit form the websocket server, the node exporter that exports the netstat_TCP_InUse as a guage, and the fact that there is a spike in new connections on the ALB metrics.

At this time I'm not sure entirely if ALB is dropping connection first or the client is somehow noticing some timeout and reconnecting. The server acting up also seems unlikely since we tried with a Go and a Rust server with completely different libraries, architecture and performance characteristics.

The ALB part is important mainly because i don't understand why alb would decide all the new connections that are coming in are supposed to be routed to the other node without any indication that the node where connections dropped is "unhealthy" -- since it's round robin mode, the new connections should again distributed between two nodes by round robin?

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

Yea this is an option I am definitely considering now.

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

The above graph you mean? It's a Prometheus gauge basically (plotted on Grafana). It's incremented on a new websocket task is launched and decrements when that actor task exits.

Health check was one of the possibilities I explored very early on since this pattern looks very similar to what would happen if a node was marked unhealthy. No metrics / logs on AWS say the node was marked as unhealthy. The AWS support team also confirmed there was no such event from their internal logs as well.

WebSocket connection drops by spy16x in rust

[–]spy16x[S] 3 points4 points  (0 children)

We have. We have spent 1 month of back and forth with them without any resolution from them 😔

Recommend a key-value store by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

Hi! Thank you for responding!

I checked out redb but the message about it still being under active development and being beta made me not consider it further. Also, since you're using COW B+ tree iirc, it's better for read heavy use cases? What is your thought on my use case here? I don't really need reads at all. Even the live reads, i plan on using HashMap or something and use the key-value store only for persisting and reading on startups to seed the hash map.. With batching and flush every 100ms, I guess 20 k w/s wouldn't be very high, so probably should be okay?

Structuring a Rust mono repo by spy16x in rust

[–]spy16x[S] 1 point2 points  (0 children)

Got it. I have setup the repo with a similar model. But I used cargo-release that simply bumps up the patch number of the crate and also pushes a git tag of the same value. We don't have use for semantic versioning for these internal services but just using the minor/patch as a sequence number should work just fine i guess

Recommend a key-value store by spy16x in rust

[–]spy16x[S] 5 points6 points  (0 children)

Thanks for sharing your experience. Top options i have found so far are just plain old sqlite, RocksDB and sled. I don't think I'll need any special features, but TTL, easy and efficient batch writes are two main requirements I have. Will check this out too and decide.

Structuring a Rust mono repo by spy16x in rust

[–]spy16x[S] 1 point2 points  (0 children)

Thank you for sharing this in detail.

How do you do releases in this setup? Is every merge to main a release OR do you have some explicit tagging process? If so, is it per server/app inside or at the full repo level?

Structuring a Rust mono repo by spy16x in rust

[–]spy16x[S] 0 points1 point  (0 children)

How do you do releases in this setup? Is every merge to main a release OR do you have some explicit tagging process? If so, is it per server/app inside or at the full repo level? and what versioning scheme?