Recently in the #general Postgres-slack channel I asked if BDR applied at the TX level or the table level. For those of you unfamiliar with BDR, it’s short for bi-directional replication and it enables multi-master setups using postgres. It is particularly suited for geographically distributed applications that have to alter data but don’t want to pay the speed of light penalty in latency.
This post originally appeared on the AppNexus techblog, I am reproducing here to keep a log of the work
Every distributed RESTful system has a communication problem. How does Service A
communicate with Service B? Does it pass data via
Does it pass individual fields on the query string? Does it POST a blob of JSON?
With the proliferation of “RESTful” services the trend is decidedly towards JSON and away from XML. JSON is relatively compact and fast to parse (at least for most services the bottleneck is not parsing the JSON). This works well for most “wait based” services (database lookup, file reads, etc.) However, there is a class of services in the ad-tech space (and elsewhere) that have more stringent SLA’s for which JSON parsing is actually a significant portion of the runtime of a single request. For these services we can do better while still keeping the schematic safety of JSON in place.
I have been evaluating CLion from Jetbrains. Lack of Makefile support makes it a little unwieldy in our environment. One thing they do get very right is the default color theme. Easy on the eyes, yet very clear.
I have attempted to duplicate this theme on emacs (Aquamacs).
CLion defaults look like this:
My emacs copy (so far):
emacs treats types differently than CLion does so I can’t get it exact. And I also prefer that the types are strongly colored vs. off white.
This relies on color-theme and here is the theme so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Recently David Iserovich and I at AppNexus ran into an issue with build scripts while porting our builds to use OBS. Prior to building via OBS, we had dedicated, older, build machines which would build our releases.
At the same time I was upgrading coverity to the latest release for better static analysis of our stack. During this coverity upgrade I was wresting with getting our various apps to compile from a single trigger script. Turns out that some of our apps did:
-march=native will cause the compiler to generate machine code that matches the processor where it is currently running when optimizing code. This will generate the best possible code for that chipset but will likely break the compiled object on older chipsets (assuming backwards compatibility).
-mtune=native will “tune” the optimized code to run best for the current chipset but will still allow backwards compatibility with older chipsets. It is important to note here that
-mtune. If you specify them both (like we were), you will get optimized code that can only run on that chip or newer chips.
In practice this wasn’t an issue for us because our sad build machine was old. Until OBS that is. The OBS build server had a shiny new Xeon E5 Sandy Bridge chip set while the old, sad, outcast build machine had:
-march used on the L5630 machine would produce optimized code for that chip. The newer E5 Sandy Bridge chips in production would run fine because they contained all the instructions already included in the L5630 chips on the build machine. However, when we started building on OBS and an E5 chip, we decided to test in a sandbox environment (which had the older L5630s) and you can imagine what happened:
Interesting behavior I have been dealing with lately.
Have you seen this perf profile before?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
I had not seen it. Probably I had not seen it because no one does this many syscalls in high performance code (dur). I googled it and nothing useful came up aside from the normal major/minor
page_fault stuff explained by the paging model in the Linux kernel.
I then asked the smartest guy I know, and he pointed me in the right direction. What follows is the explanation in case you run into this. I suspect no one else will run into this because it has to do with libc/kernel mismatches.
I am hosting this blog on sdf.org. I realized recently that I have been a member since 2004!
1 2 3 4
If you don’t know what it is, please visit the link above and join if you want it’s free!
Extremely useful when you need a shell from anywhere in the world, backups of small things, simple hosting, general awesomeness.
Consider donating, or buying a membership at a higher level.
Support public access.
Inspired by a colleague, I am going to blog about stuff. Welcome here.