←back to thread

125 points todsacerdoti | 9 comments | | HN request time: 0.455s | source | bottom
1. nvahalik ◴[] No.45040957[source]
When doing web development I will occasionally connect my local code base to a remote SQL server via SSH.

This adds enough latency to be noticeable and I’ve found pages that were “OK” in prod that were unbearable in my local environment. Most of the time it was N+1 queries. Sometimes it was a cache that wasn’t working as intended. Sometimes it simply was a feature that “looked cool” but offered no value.

I’m not sure if there is a proxy that would do this locally but I’ve found it invaluable.

replies(3): >>45041182 #>>45042663 #>>45042957 #
2. enlyth ◴[] No.45041182[source]
I'm a big fan of Toxiproxy for these kinds of things:

https://github.com/Shopify/toxiproxy

replies(2): >>45041439 #>>45041908 #
3. calebh ◴[] No.45041439[source]
I do networked game development on Windows and I've found the clumsy program to be very valuable to simulate adverse network conditions. You can set it up to simulate arbitrary network latency, packet loss and so forth.

https://jagt.github.io/clumsy/

replies(2): >>45042615 #>>45046576 #
4. nvahalik ◴[] No.45041908[source]
This looks interesting. I'll check it out, thank you!
5. DrillShopper ◴[] No.45042615{3}[source]
You can use the tc command from the netem package for those wondering how to achieve this on Linux. https://man7.org/linux/man-pages/man8/tc-netem.8.html
6. pseudocomposer ◴[] No.45042663[source]
I do this with a Makefile that calls “kubectl port-forward.”
7. nawgz ◴[] No.45042957[source]
I’m not sure if you’re saying the latency was introduced in client <-> server hops or server <-> db hops, but chrome dev tools (I’m sure all browsers too) can simulate different network conditions with a few clicks! Useful for something similar to what you’ve said, but in the end I think you meant server <-> db latency is what you want to inject
replies(1): >>45045787 #
8. MetaWhirledPeas ◴[] No.45045787[source]
This was the first thing I thought of. Dev Tools in any browser have a boatload of great stuff like this.
9. raisedbyninjas ◴[] No.45046576{3}[source]
+1 for clumsy On Windows I've also used Heavy Load, Netlimiter for more fine-grained control and Microsoft's Driver Verifier.