thread_pool_hybrid slow case

In one of the BMK benchmarks I’ve run, thread_pool_hybrid is significantly slower than connection_per_thread. To whit:

Now while this has the advantage of being being able to host 65536 clients while vanilla mysql crashes, it’s throughput is slower throughout the range of clients until then.

This benchmark is a reconnect case, each client connects, makes a query and disconnects, at least 4 times (maybe more, I’m not sure), which reveals a slowness in my connection handler. Either it’s slow to create connections, or slow to shut them down.

Let’s see if the other graphs give any insights.

Latency just say ‘yup, you’re slower. Dang.

Memory is roughly equal, but connection_per_thread starts to blow up at 32768, which is likely why it dies before it finishes the test, OOM.

CPU is greater for the life of the connection_per_thread handler, but that’s what I’d expect as it’s got around 2x throughput, it’s using more CPU because its doing more work.

So either my connection handler is slow to connect, or slow to disconnect. I haven’t figure out which yet, and why. LMK if you have any ideas.

Comments

2 responses to “thread_pool_hybrid slow case”

  1. Bob Lomme Avatar
    Bob Lomme

    It’s likely the close operation is blocking. It may be flushing buffers of any unsent data. Check out SO_LINGER option on close0. For speed don’t flush the buffers. Local state may need to be updated to reflect that the data was not sent. If you require “guaranteed” delivery, then call shutdown in advance of close to make things more async.

    Like

  2. Damien Katz Avatar

    I don’t know if those are the problems, but they are at least concrete advice for things to try and I will try them. Thank you

    Like

Leave a comment