Do you think you know?

I was sure that our database connections were slow.

I mean the evidence was in my face.

The queries were taking a long time.

At least that’s what it looked like.

So I decided to figure out EXACTLY what wasn’t working.

I added timing to the code.

Doing that allowed me to see what exactly was taking time.

I won’t bore you with code logs here.

Init Duration: 4833 ms

  • MongoDB database connection time: 1758138307.06 seconds (bogus delta calc)

  • MongoDB database connection time: 0.05 seconds

  • MongoDB database connection time: 0.03 seconds

  • MongoDB database connection time: 0.06 seconds

  • MongoDB database connection time: 0.05 seconds

  • MongoDB database connection time: 0.06 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 5.59 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 15.11 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.57 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.55 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.56 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.52 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.59 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.57 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.56 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.55 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.56 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.58 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.56 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.59 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.55 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.56 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.55 seconds

  • Query time for dataset_id=680fe3d7c3fa…: 0.57 seconds

⚠️ Plus two invocations ended with: Status: timeout (30s).

Yeah it’s the database…

Must be borked right?

It could be faster but that is not the point I’m talkin about here.

I’m actually talking about how my impression of what was happening wasn’t what was happening at all.

Hmmm.

How often to do look at results and decide it has to be X,Y, or Z?

All the time.

The right data tells you you are looking at a non-issue. To look elsewhere.

Here’s an example closer to home…

MRR is going up.

So you think, “yeah baby we are doing it right!“

And in some respect you probably are.

But what if the sales department just got really good at selling a new segment in a new market?

And every market it finite.

Hmmm.

And what if on the other side of the equation, customers are staying one month less than they used to?

Yes you are adding customers at pace… but they aren’t staying as long.

Is MRR telling this story?

Not necessarily.

Keep Reading