Skip to content

Instantly share code, notes, and snippets.


Ivan Kolev InKolev

  • Bulgaria
View GitHub Profile
View Software Systems Troubleshooting

Multi-tenant systems

Check if the observed behavior is the same for other tenants, not just for a single one. The wider the dataset, the easier it becomes to isolate the probem.

Check for data bleed accross tenants

  • Configuration mix
  • HTTP requests routed to the wrong tenant
  • Message bus listeners consuming and processing data for the wrong tenant or for more than 1 tenants.
View Useful Linux

Find largest files on disk (where size is bigger than 100MB)

sudo find / -xdev -type f -size +100M -exec du -sh {} ';' | sort -rh | head -n50

PM2 node process manager

pm2 start ecosystem.config.js

Sample ecosystem file

View Quotes that relate to Software

Conway's law

"Any organization that designs a system, will produce a design
whose structure is a copy of the organization's communication structure."

Jimmy's law

"A broken, dysfunctional organization, driven by meeting unhealthy goals and metrics
will produce broken, dysfunctional systems, even if the developers in that organization are good."

Kosh (Babylon 5)

"The avalanche has already started. It is too late for the pebbles to vote."

View Kafka Rollout

Bet Settlement Worker (x1)

  • 40-50k items per minute (3000 cursor size, 1000 concurrency counter, 500 batch size, 250 ms timeout)

Account Operation Workers (x6)

  • 25-45k items per minute (with 3ms SQL Delay)
  • 30-50k items per minute (with 0ms SQL Delay)

Combo Bonus Workers (x6) (Slowest)

  • 18-40k items per minute (with 3ms SQL Delay)
  • 25-45k items per minute (with 0ms SQL Delay
View tuning librdkafka

Building Kafka from the Hardware - up

  • Higher Message Retention ? - Increase disk size
  • Higher Message Throughput ? - Increase network capacity
  • Higher Producer Performance ? - Increase Disk I/O speed
  • Higher Consumer Performance ? - Increase Memory

Critical Configurations (Consumer)

  • queued.min.messages
View API
  1. Get authorization token POST


Local IP addresses


Useful commands

  • Create a topic named integration-test-topic with two partitions:

    • kafka-topics --create --zookeeper --replication-factor 1 --partitions 2 --topic integration-test-topic
  • Check topic information:

    • kafka-topics --zookeeper --describe --topic integration-test-topic

Memory Management in .NET

"If you don't ultimately have a root reference, then you can't be accessed, so you must die."

Brief overview


  • Allocates objects smaller than 85K
  • Objects are allocated on top of each other, a Next Object Pointer (NOP) represents the location where the next object will be allocated.
  • Because the NOP position is known, a new object can be immediately allocated without the overhead of looking for space in a Free Space tables.

Unit testing - Brief overview

The definition of a unit test (by Roy Osherove)


A unit of work is the sum of actions that take place between the invocation of a public method in the system and a single noticeable end result by a test of that system. A noticeable end result can be observed without looking at the internal state of the system and only through its public APIs and behavior. An end result is any of the following:

  • The invoked public method returns a value (a function that’s not void).
  • There’s a noticeable change to the state or behavior of the system before and after invocation that can be determined without interrogating private state.
  • There’s a callout to a third-party system over which the test has no control, and that third-party system doesn’t return any value, or any return value from that system is ignored. (Example: calling a third-party logging system that was not written by you and you don’t have the source to.)

Unstage all files staged for commit

  • Command
git reset HEAD -- .

Revert to previous commit, discarding all changes made locally

  • Command
git reset --hard HEAD